You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue where autocomplete would only work for one of the workspaces but not the others. In particular it only worked for the workspace that I started the server from but not the others.
From what I can gather, this occurs because the environment is server specific rather than workspace specific (specified by the env_path field in the LanguageServer and thus does not change wrt. workspace being queried).
It's a bit unclear to me if this is the desired behavior for LanguageServer.jl and lsp-julia is doing something wrong, or if LanguageServer.jl should instead make the environment local to workspaces rather than servers.
Anyhow, I believe this can be fixed by simply dropping specification of :multi-root when registering the lsp client, i.e. remove this line: https://github.com/non-Jedi/lsp-julia/blob/c523c250c4bd2777203101ab417e9b7312472f46/lsp-julia.el#L298. This will make it so that lsp-mode creates a new server for every workspace rather than reusing the same server for all workspaces, thus allowing separate environments for different servers. Though you need to remember to delete the workspace file for lsp-mode so as to reset or remove the Julia workspaces for this change to take effect.
But even if this is actually LanguageServer.jl not providing the correct functionality, it's probably a good idea to raise an issue over there but also implement this hotfix while we wait for the bug to be fixed.
The text was updated successfully, but these errors were encountered:
adding this line actually made it work at some point, see emacs-lsp/lsp-mode#1680. If you could test if it works without multi-root and report back, maybe something has changed since then.
I ran into an issue where autocomplete would only work for one of the workspaces but not the others. In particular it only worked for the workspace that I started the server from but not the others.
From what I can gather, this occurs because the environment is server specific rather than workspace specific (specified by the
env_path
field in theLanguageServer
and thus does not change wrt. workspace being queried).It's a bit unclear to me if this is the desired behavior for LanguageServer.jl and
lsp-julia
is doing something wrong, or if LanguageServer.jl should instead make the environment local to workspaces rather than servers.Anyhow, I believe this can be fixed by simply dropping specification of
:multi-root
when registering the lsp client, i.e. remove this line: https://github.com/non-Jedi/lsp-julia/blob/c523c250c4bd2777203101ab417e9b7312472f46/lsp-julia.el#L298. This will make it so thatlsp-mode
creates a new server for every workspace rather than reusing the same server for all workspaces, thus allowing separate environments for different servers. Though you need to remember to delete the workspace file forlsp-mode
so as to reset or remove the Julia workspaces for this change to take effect.But even if this is actually LanguageServer.jl not providing the correct functionality, it's probably a good idea to raise an issue over there but also implement this hotfix while we wait for the bug to be fixed.
The text was updated successfully, but these errors were encountered: