File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ module UnusedOpens =
278
278
279
279
/// Filter out the open statements whose contents are referred to somewhere in the symbol uses.
280
280
/// Async to allow cancellation.
281
- let filterOpenStatements ( symbolUses1 : FSharpSymbolUse [], symbolUses2 : FSharpSymbolUse []) openStatements =
281
+ let filterOpenStatements ( symbolUses1 : FSharpSymbolUse [], symbolUses2 : FSharpSymbolUse []) ( openStatements : OpenStatement []) =
282
282
async {
283
283
// the key is a namespace or module, the value is a list of FSharpSymbolUse range of symbols defined in the
284
284
// namespace or module. So, it's just symbol uses ranges grouped by namespace or module where they are _defined_.
@@ -297,17 +297,13 @@ module UnusedOpens =
297
297
| _ -> ()
298
298
| _ -> ()
299
299
300
- // We want to check them from last to first.
301
- // See https://github.com/dotnet/fsharp/issues/16226
302
- let reversedOpenStatements = openStatements |> List.ofArray |> List.rev
300
+ let openStatements =
301
+ openStatements
302
+ |> List.ofArray
303
+ |> List.distinctBy (_. OpenedGroups >> List.map (_. OpenedModules >> Array.map _. Entity))
303
304
304
305
let! results =
305
- filterOpenStatementsIncremental
306
- symbolUses2
307
- symbolUsesRangesByDeclaringEntity
308
- reversedOpenStatements
309
- ( Dictionary( entityHash))
310
- []
306
+ filterOpenStatementsIncremental symbolUses2 symbolUsesRangesByDeclaringEntity openStatements ( Dictionary( entityHash)) []
311
307
312
308
return results |> List.map ( fun os -> os.Range)
313
309
}
You can’t perform that action at this time.
0 commit comments