-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FSharpSymbol.ImplementationLocation points to definition in FSI file across multiple projects #545
Comments
Yeah Ive got annoyed by that at times, jumping to the fsi is annoying |
Added a fix - next time you could probably have got this one :) |
I tried #548 and the bug is still here: |
Ah, I hadn't tried the multi-project case. Well, the PR fixed a real bug in any case :) The cross-project case may not be that easily fixable, since the F# metadata propagated between projects has only space for one range, see https://github.com/fsharp/FSharp.Compiler.Service/blob/master/src/fsharp/TastPickle.fs#L1975 for example. When compiling a set of related projects using FCS in a single multi-project graph it's possible that we can propagate the extra information in a lookaside table of some kind. |
Thanks I believe it works correctly for results from whole project analysis using I assume the above signature symbols are just from checking a single signature file using The locations should be correct for results from |
Thanks. let (|SignatureFile|_|) file =
if Path.GetExtension file = ".fsi" then
let implFile = Path.ChangeExtension(file, ".fs")
if File.Exists implFile then Some implFile else None
else None
let! results =
match currentFile with
// it's signature file and the impl file presents
| SignatureFile implementationFile ->
async {
let source =
openDocumentsTracker.TryGetDocumentText implementationFile
|> Option.getOrTry (fun _ -> File.ReadAllText implemen
// check impl file
let! _ = instance.ParseAndCheckFileInProject(opts, implementationFile, source, stale)
// check sig file
let! _ = instance.ParseAndCheckFileInProject(opts, currentFile, source, stale)
// get background check results for sig file
return! instance.GetBackgroundCheckResultsForFileInProject(opts, currentFile)
}
// this is how it previously works
| _ -> instance.ParseAndCheckFileInProject(opts, currentFile, source, stale)
|> liftAsync When I try Maybe |
Perhaps this:
However, assuming this works at all, it will only work for the contents of the signature and implementation files as reported by the IFileSystem - not for a source text passed as a parameter. Calls to |
File1.fsi
File1.fs
Library1.fs in different project
FSharpSymbolUse.Symbol
forField1
in Library1.fs has identicalDeclarationLocation
,ImplementationLocation
andSignatureLocation
:This bug makes it very hard to implement this VFPT feature: fsprojects-archive/zzarchive-VisualFSharpPowerTools#1351
The text was updated successfully, but these errors were encountered: