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

Commit6085f0b

Browse files
Vasily KirichenkoVasily Kirichenko
Vasily Kirichenko
authored and
Vasily Kirichenko
committed
consider definitions because they can be used at type extensions point
1 parent03ecab2 commit6085f0b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/fsharp/vs/ServiceAnalysis.fs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ module UnusedOpens =
5858

5959
letfilterSymbolUses(getSourceLineStr:int->string)(symbolUses:FSharpSymbolUse[]):FSharpSymbolUse[]=
6060
symbolUses
61-
|> Array.filter(fun su->not su.IsFromDefinition)
6261
|> Array.filter(fun su->
6362
match su.Symbolwith
64-
|:? FSharpMemberOrFunctionOrValueas fvwhen fv.IsExtensionMember->true
63+
|:? FSharpMemberOrFunctionOrValueas fvwhen fv.IsExtensionMember->
64+
// extension members should be taken into account even though they have a prefix (as they do most of the time)
65+
true
6566
|_->
6667
letpartialName= QuickParse.GetPartialLongNameEx(getSourceLineStr su.RangeAlternate.StartLine, su.RangeAlternate.EndColumn-1)
68+
// for the rest of symbols we pick only those which are the first part of a long idend, because it's they which are
69+
// conteined in opened namespaces / modules. For example, we pick `IO` from long ident `IO.File.OpenWrite` because
70+
// it's `open System` which really brings it into scope.
6771
partialName.QualifyingIdents=[])
6872

6973
letgetUnusedOpens(checkFileResults:FSharpCheckFileResults,getSourceLineStr:int->string):Async<rangelist>=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp