-
Notifications
You must be signed in to change notification settings - Fork 1
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
Setting up LSP-Julia on Linux #12
Comments
Hi, the docs link you posted is outdated, the current version for LSP on Sublime Text 4 is https://lsp.sublimetext.io/. I must say that I have only tested the installation on Windows, but I see no reason why it wouldn't work on Linux. So if you install LSP-julia (and of course LSP) via package control, then everything should work automatically. You just need to wait a bit until the package manager has installed the language server, but it should be displayed in the status bar. Feedback if it works for you on Linux would be appreciated. By the way, the shell script in the "command" for Linux isn't really needed anymore, afaik it was just a workaround for a former bug in the LSP version on Sublime Text 3, which caused server processes not being killed after closing Sublime Text in some cases. |
Well, that definitely didn't happen for me. Of course I first tried just following the guide here but when it didn't work I started troubleshooting myself. I'll give it another go tomorrow, on a minimally configured distro that I should have on a thumb-drive somewhere. For all I know, I might have just not waited long enough. But I do remember getting a "julia exited with error code 1" or something like that. |
Hm, could you look if you have a folder under $Data/Package Storage/LSP-julia? I'm not sure where the Sublime Text Data path ($Data) exactly is under Linux, but you should find it if you run Also you could see if there are any errors in the ST console? |
Ok, so following the guide on an almost clean install I get "julia exited with status code 1" pop-up with
in "Output: Language servers" and no errors in the ST "Console" Here is the LSP-julia folder it generates in the process |
I think the "julia exited with status code 1" pop-up is created by LSP trying to start the server, even though it hasn't been installed correctly. The folder looks exactly as it is supposed to be, and the "ready" file should only have been created if the installation was successful. After copying the Project.toml/Manifest.toml files, the plugin runs the "Pkg.instantiate()" in Line 156 in 91fc2f8
On Windows, Pyhton's What happens if you manually run the same command in a shell:
Maybe I have missed something and the returncode can still be 0, even when there is some kind of error or unexpected result. (After successfully running the command, the language server should start working for you too, but ideally we want to know why it doesn't work from this LSP-julia plugin.) |
After running the command in a terminal, the language server start without an issue. Well, the return code was 1 for me... from my experience it could be something as simple as the space in |
On a potentially related note, I was expecting I'd see documentation on hover for functions from all packages, not just those in |
The "ready" file should not have been created if the returncode was 1: Lines 157 to 162 in 91fc2f8
Documentation on hover for functions from all packages is what is supposed to happen. Make sure that you have chosen the correct Julia environment (displayed in the status bar), and maybe wait a little bit in case the server is still indexing packages (also displayed in the status bar). |
Is there any way to get more logs? I feel like I am not giving you any relevant information. Also, the file I am editing is inside of |
There is a command in the command palette to change the active Julia environment which is used to get the symbol information, autocomplete, and other features which depend on the environment's packages. LSP-julia should in most cases already determine the correct environment when the server is started, which seems to be the case for you.
Ah, so you're basically developing the RigidBodyDynamics package. There is a known bug/inconvenience that the language server doesn't index the active project, so that's probably why the hover for functions from other files of that package doesn't work for you. It is tracked at julia-vscode/LanguageServer.jl#988. A possible temporary workaround could be to explicitly |
Huh, the interesting thing is that once I changed the LSP-julia environment to "v1.6" I started getting hovers, etc. for all packages including |
Then you have probably added all those packages to your global default environment. I'd recommend reading the section about environments in the Julia docs https://docs.julialang.org/en/v1/manual/code-loading/#Environments and in Pkg.jl https://pkgdocs.julialang.org/v1/environments/ and to create separate project environments for all non-trivial projects to reduce the risk of package version incompatibilities. If you |
Thank you very much for everything. This last piece of information about the environments will certainly come in handy at some point. |
Hi, mostly out of interest I wanted to set-up a Julia LS in Sublime-Text version 4.4121-1 running on Manjaro with kernel version 5.14.18-1 and I must say I found the installation guide very lacking.
I had to do a bit of googling to figure out that i first need to run
as described in LSP docs.
And after installing LSP-julia I have to modify the "command" setting in
LSP-julia.sublime-settings
toWhere the path can be found by running
I suggest that some of these steps should be added to the "README".
The text was updated successfully, but these errors were encountered: