julia-vscode / LanguageServer.jl

An implementation of the Microsoft Language Server Protocol for the Julia language.
Other
368 stars 81 forks source link

LanguageServer does not index active project/package #988

Open fredrikekre opened 3 years ago

fredrikekre commented 3 years ago

For example, in the root of the Example.jl repo when editiing a file foo.jl using Example gives "Missing reference" and same with functions defined within Example.

Roger-luo commented 3 years ago

I believe this in dup of https://github.com/julia-vscode/julia-vscode/issues/800 and https://github.com/julia-vscode/LanguageServer.jl/pull/498 is a try to fix it but it seems not having any progress yet

fredrikekre commented 2 years ago

Just leaving some breadcrumbs for when I (or someone else) have time to look at this again: https://github.com/julia-vscode/LanguageServer.jl/blob/781240a00dc9eecefb561e707ee117b23425ed85/src/multienv.jl#L73-L82 looks like it is supposed to handle this (but just for files in test/), but this never works since the package itself is not indexed in the SymbolServer. (It does work if you coerce Pkg to add the package to itself, but then you get the cloud-indexed symbols and not the live ones).

jarbus commented 1 year ago

Jesus I thought I was going insane. Experiencing this behavior too, it's really counter-intuitive.

PetrKryslUCSD commented 1 year ago

This really makes LSP useless for package development. I get so many missing refs that it is really hard to find real problems in there. https://discourse.julialang.org/t/lsp-missing-reference-woes/98231/8