If I am working on a package and add new functions the language server does not index them, which means hovering over the name of this function in examples or tests shows nothing and goto definition does not work.
The fun thing is, if I do a fresh checkout of my package into a new directory it works.
Is there a way to force the language server to re-index a package?
Where does it store its indices? Perhaps deleting any existing index might help, but I do not know where they are stored.
I’d also like to know if there’s a nice way to do this, ideally in my case from within emacs. I haven’t been having any difficulties with this recently, but for a while SymbolServer was tracking changes to whatever project I was actively working on, but if I made changes to some of my own packages that were deved dependencies, it wouldn’t track those. I’m not sure if I’m not seeing the problem because something was fixed or not. Recently I haven’t been doing all that much of that sort of work in which I’m changing several packages at once. So it’s possible I just haven’t noticed it recently.
In any event, I did what you were thinking of doing, and deleting the files. It did force a reindex and it fixed my immediate problem. You need to find the SymbolServer store directory. For me it is ~/.julia/packages/SymbolServer/2jiVV/store/
.
I do not have a directory .julia/packages/SymbolServer
.
I have only:
/packages/SymbolServer/store$ locate store | grep SymbolServer
/home/ufechner/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/SymbolServer/store
/home/ufechner/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/SymbolServer/store/.gitignore
But this store
directory is empty.
That is unfortunate. Maybe vscode does something to make sure the files are stored somewhere else. Unless something else is different on my system the convention seems to result in directories named things like LinearAlgebra_37e2e46d-f89d-539d-b4ee-838fcccc9c8e
. That is the package name and the uuid, I believe. That particular directory on my system has a file v1.10.3_nothing.jstore
. Maybe that gives you something else to hunt for?
1 Like
I found the directory: .config/Code/User/globalStorage/julialang.language-julia/symbolstorev5
Thanks for your help!
But unluckily deleting the index file of my package does not solve the problem.
Sorry to hear it. Maybe someone more knowledgeable about how all this works will jump into the thread. Did it force a reindex and result in a file being recreated in that location? If your problem has the same cause as mine, the only thing I can think of now is that maybe the index files you are actually using are somewhere else, although that seems unlikely if you are using locate. On my own system, I have some older stores still sitting around from older versions of SymbolServer. And, now that I think about it, I seem to remember that at some point when I was switching between lsp-julia
and eglot-jl
in emacs, there was a different path. It got fairly confusing and I created a symlink to the right store so I wouldn’t have to hunt for it every time.
I am facing a similar issue. In VScode, there is a command: Julia: Re-Index Language Server Cache
(@ufechner7 I assume you were aware of this, but if not, this might be sufficient for your use case). Unfortunately this command re-indexes everything and also seems to download symbol caches etc which is slow. I would like to specify a set of directories for Julia LSP to watch and reindex continually (this would be useful for dev dependencies and mono repos with multiple packages). I was about to create an issue, but thought I would post here first to see if there are comments / existing workflows that address my concerns. Cheers. nehal