diff --git a/src/FsAutoComplete.Core/Commands.fs b/src/FsAutoComplete.Core/Commands.fs index a70c78151..2d839758d 100644 --- a/src/FsAutoComplete.Core/Commands.fs +++ b/src/FsAutoComplete.Core/Commands.fs @@ -514,11 +514,15 @@ module Commands = = let filterSymbols symbols = - symbols - |> Array.where (fun (su: FSharpSymbolUse) -> - su.IsFromDispatchSlotImplementation - || (su.IsFromType - && not (tyRes.GetParseResults.IsTypeAnnotationGivenAtPosition(su.Range.Start)))) + if Utils.isSignatureFile (UMX.untag tyRes.FileName) then + let implFile = Utils.toFSharpFile (UMX.untag tyRes.FileName) + symbols |> Array.filter (fun (su: FSharpSymbolUse) -> su.FileName = implFile) + else + symbols + |> Array.where (fun (su: FSharpSymbolUse) -> + su.IsFromDispatchSlotImplementation + || (su.IsFromType + && not (tyRes.GetParseResults.IsTypeAnnotationGivenAtPosition(su.Range.Start)))) async { match tyRes.TryGetSymbolUseAndUsages pos lineStr with diff --git a/src/FsAutoComplete.Core/Utils.fs b/src/FsAutoComplete.Core/Utils.fs index b3fbe2663..16df1fc3e 100644 --- a/src/FsAutoComplete.Core/Utils.fs +++ b/src/FsAutoComplete.Core/Utils.fs @@ -124,6 +124,9 @@ let inline isAScript (fileName: ReadOnlySpan) = /// let inline isSignatureFile (fileName: ReadOnlySpan) = fileName.EndsWith ".fsi" +let toSignatureFile fileName = + IO.Path.ChangeExtension(fileName, ".fsi") + /// /// Checks if the file ends with `.fs` /// @@ -132,6 +135,9 @@ let isFsharpFile (fileName: ReadOnlySpan) = fileName.EndsWith ".fs" let inline internal isFileWithFSharpI fileName = isAScript fileName || isSignatureFile fileName || isFsharpFile fileName +let toFSharpFile fileName = + IO.Path.ChangeExtension(fileName, ".fs") + /// /// This is a combination of `isAScript`, `isSignatureFile`, and `isFsharpFile` ///