Skip to content
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

Multiple workspaces using same server causes issues #44

Open
torfjelde opened this issue Mar 3, 2021 · 1 comment
Open

Multiple workspaces using same server causes issues #44

torfjelde opened this issue Mar 3, 2021 · 1 comment

Comments

@torfjelde
Copy link

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.

@gdkrmr
Copy link
Owner

gdkrmr commented Mar 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants