Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1d5a782

Browse files
vasily-kirichenkoTIHan
authored andcommitted
Do not show "rename unused declaration" code fix on functions and methods (#4094)
* do not show "rename unused declaration" code fix on functions and methods* IsFunctionOrMember -> IsValue
1 parent6d3f6de commit1d5a782

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

‎src/fsharp/symbols/Symbols.fs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,11 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) =
18061806
| V valRef-> IlxGen.IsValCompiledAsMethod cenv.g valRef.Deref
18071807
|_->false
18081808

1809+
memberx.IsValue=
1810+
match dwith
1811+
| V valRef->not(SymbolHelpers.isFunction cenv.g valRef.Type)
1812+
|_->false
1813+
18091814
overridex.Equals(other:obj)=
18101815
box x=== other||
18111816
match otherwith

‎src/fsharp/symbols/Symbols.fsi‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,9 @@ and [<Class>] internal FSharpMemberOrFunctionOrValue =
883883

884884
/// Indicated if this is a value compiled to a method
885885
memberIsValCompiledAsMethod:bool
886+
887+
/// Indicated if this is a value
888+
memberIsValue:bool
886889

887890
/// Indicates if this is a constructor.
888891
memberIsConstructor:bool

‎vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type internal FSharpRenameUnusedValueCodeFixProvider
6969

7070
if func.IsMemberThisValuethen
7171
createCodeFix(context, symbolName, SR.RenameValueToDoubleUnderscore(), TextChange(context.Span,"__"))
72-
elifnotfunc.IsMemberthen
72+
elif func.IsValuethen
7373
createCodeFix(context, symbolName, SR.RenameValueToUnderscore(), TextChange(context.Span,"_"))
7474
|_->()
7575
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp