File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -780,10 +780,21 @@ module Commands =
780780 let symbolUses = tyRes.GetCheckResults.GetUsesOfSymbolInFile( symbol, ct)
781781
782782 let symbolUses : _ seq =
783- if includeDeclarations then
784- symbolUses
785- else
786- symbolUses |> Seq.filter ( fun u -> not u.IsFromDefinition)
783+ let filtered =
784+ if includeDeclarations then
785+ symbolUses
786+ else
787+ symbolUses |> Seq.filter ( fun u -> not u.IsFromDefinition)
788+
789+ // For Active Pattern Cases, FCS returns all cases in the pattern, not just the specific one
790+ // We need to filter to only the symbol that matches our query
791+ match symbolUse.Symbol with
792+ | : ? FSharpActivePatternCase as apc ->
793+ filtered |> Seq.filter ( fun u ->
794+ match u.Symbol with
795+ | : ? FSharpActivePatternCase as foundApc -> foundApc .Name = apc .Name
796+ | _ -> false )
797+ | _ -> filtered
787798
788799 let ranges = symbolUses |> Seq.map ( fun u -> u.Range)
789800 // Note: tryAdjustRanges is designed to only be able to fail iff `errorOnFailureToFixRange` is `true`
You can’t perform that action at this time.
0 commit comments