Skip to content

Commit

Permalink
Add some more pointers.
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Nov 10, 2023
1 parent 4ee4d26 commit be0375a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/FsAutoComplete/CodeFixes/UpdateValueInSignatureFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ let fix (getParseResultsForFile: GetParseResultsForFile) : CodeFix =
// Find a matching val in the signature file.
let sigVisitor =
{ new SyntaxVisitorBase<_>() with
override x.VisitModuleSigDecl
(
path: SyntaxVisitorPath,
defaultTraverse,
synModuleSigDecl: SynModuleSigDecl
) =
defaultTraverse synModuleSigDecl

override x.VisitValSig
(
path,
Expand All @@ -108,10 +100,15 @@ let fix (getParseResultsForFile: GetParseResultsForFile) : CodeFix =
| Some(mValSig, sigPath) ->

// Verify both nodes share the same path.
// TODO: not sure how relevant this check still is.
// Using the mfv.SignatureLocation is probably already enough to pinpoint the correct val.
// This check was introduced to verify vals with the same name (but in different nested modules) are not getting mixed up.
if not (assertPaths sigPath implPath) then
return []
else
// Find matching symbol in signature file, we need it for its DisplayContext
// GetValSignatureText will take the open namespaces into account when printing the types.
// The implementation file might have different opens than the signature.
let sigSymbolUseOpt =
sigParseAndCheckResults.GetCheckResults.GetSymbolUseAtLocation(
mSig.End.Line,
Expand Down

0 comments on commit be0375a

Please sign in to comment.