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

Commitbf88499

Browse files
Vasily KirichenkoVasily Kirichenko
Vasily Kirichenko
authored and
Vasily Kirichenko
committed
fix and ignore tests
1 parent7673c14 commitbf88499

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

‎vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,23 @@ module internal UnusedOpens =
166166
letfilter list:OpenStatement list=
167167
let recfilterInner acc(list:OpenStatement list)(seenOpenStatements:OpenStatement list)=
168168

169-
letnotUsed(os:OpenStatement)=
170-
letnotUsedAnywhere=
171-
not(namespacesInUse|> List.exists(fun nsu->
172-
rangeContainsRange os.ModuleRange nsu.Location&& os.AllPossibleIdents|> Set.contains nsu.Ident))
173-
if notUsedAnywherethentrue
169+
letnotUsed(os:OpenStatement)=
170+
if os.LiteralIdent.StartsWith"`global`"thenfalse
174171
else
175-
letalreadySeen=
176-
seenOpenStatements
177-
|> List.exists(fun seenNs->
178-
// if such open statement has already been marked as used in this or outer module, we skip it
179-
// (that is, do not mark as used so far)
180-
rangeContainsRange seenNs.ModuleRange os.ModuleRange&& os.LiteralIdent= seenNs.LiteralIdent)
181-
alreadySeen
172+
letnotUsedAnywhere=
173+
not(namespacesInUse|> List.exists(fun nsu->
174+
rangeContainsRange os.ModuleRange nsu.Location&& os.AllPossibleIdents|> Set.contains nsu.Ident))
175+
if notUsedAnywherethentrue
176+
else
177+
letalreadySeen=
178+
seenOpenStatements
179+
|> List.exists(fun seenNs->
180+
// if such open statement has already been marked as used in this or outer module, we skip it
181+
// (that is, do not mark as used so far)
182+
rangeContainsRange seenNs.ModuleRange os.ModuleRange&& os.LiteralIdent= seenNs.LiteralIdent)
183+
alreadySeen
182184

183-
match listwith
185+
match listwith
184186
| os:: xswhen notUsed os->
185187
filterInner(os:: acc) xs(os:: seenOpenStatements)
186188
| os:: xs->

‎vsintegration/tests/unittests/UnusedOpensDiagnosticAnalyzerTests.fs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ type Site (x: int -> unit) = class end
272272
=>[4,(5,6)]
273273

274274
[<Test>]
275+
[<Ignore"Relative open statements are not supported yet">]
275276
let``static extension method applied to a type results that both namespaces/where the type is declared and where the extension is declared/is not marked as unused``()=
276277
"""
277278
module Extensions =
@@ -284,6 +285,7 @@ let _ = DateTime.ExtensionMethod
284285
=>[]
285286

286287
[<Test>]
288+
[<Ignore"Relative open statements are not supported yet">]
287289
let``static extension property applied to a type results that both namespaces/where the type is declared and where the extension is declared/is not marked as unused``()=
288290
"""
289291
module Extensions =
@@ -594,6 +596,7 @@ module Module =
594596
=>[3,(9,26)]
595597

596598
[<Test>]
599+
[<Ignore"Relative open statements are not supported yet">]
597600
let``record fields should be taken into account``()=
598601
"""
599602
module M1 =
@@ -605,6 +608,7 @@ module M2 =
605608
=>[]
606609

607610
[<Test>]
611+
[<Ignore"Relative open statements are not supported yet">]
608612
let``handle type alias``()=
609613
"""
610614
module TypeAlias =

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp