Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/FsAutoComplete.Core/Commands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/FsAutoComplete.Core/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ let inline isAScript (fileName: ReadOnlySpan<char>) =
/// </summary>
let inline isSignatureFile (fileName: ReadOnlySpan<char>) = fileName.EndsWith ".fsi"

let toSignatureFile fileName =
IO.Path.ChangeExtension(fileName, ".fsi")

/// <summary>
/// Checks if the file ends with `.fs`
/// </summary>
Expand All @@ -132,6 +135,9 @@ let isFsharpFile (fileName: ReadOnlySpan<char>) = fileName.EndsWith ".fs"
let inline internal isFileWithFSharpI fileName = isAScript fileName || isSignatureFile fileName || isFsharpFile fileName


let toFSharpFile fileName =
IO.Path.ChangeExtension(fileName, ".fs")

/// <summary>
/// This is a combination of `isAScript`, `isSignatureFile`, and `isFsharpFile`
/// </summary>
Expand Down