-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
simplify Julia config #1811
simplify Julia config #1811
Conversation
""" | ||
using LanguageServer; | ||
using Pkg; | ||
import StaticLint; | ||
env_path = dirname(Pkg.Types.Context().env.project_file); | ||
server = LanguageServer.LanguageServerInstance(stdin, stdout, env_path, ""); | ||
server.runlinter = true; | ||
run(server); | ||
""", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed to be the recommended config that would properly detect the project dir, as well as set up the linter: https://github.com/julia-vscode/LanguageServer.jl/wiki/Vim-and-Neovim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs seem to be all over the place though, with README suggesting one version, and kakoune wiki another
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of the wiki stuff is just outdated and runserver()
is now the recommended option.
https://github.com/julia-vscode/LanguageServer.jl/blob/master/src/runserver.jl
runserver()
should detect an exsting project dir automatically, linting is enabled by default.
At least for me everything seems to work fine with this setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an issue where I get different false positive lint messages for the new and old setup. VScode works fine. Need to dig a bit to see what's going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked it again. Detection of local environments was broken with the old config, now everything should work as expected.
There are some false positives for both configs after the initial loading of a file, but they disappear after a save.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good then 👍🏻
Naively installing the julia language server as documented and launching helix with a julia file in a project does not start the language server for me successfully. I get the following error:
Which indicates to me that the language server specific environment mentioned in the documentation is not being picked up. I added
What am I doing wrong? |
The install instructions seem to be old and copied from the neovim extension. The helix script assumes that |
Thanks! That does make the errors go away and the logs do suggest the lsp is running, but helix still claims there's no language server, stating |
Do maybe get a timeout message in your logs? If so, try to increase your timeout by adding this to your [[language]]
name = "julia"
language-server = { command = "julia", timeout = 60, args = [
"--startup-file=no",
"--history-file=no",
"--quiet",
"-e",
"using LanguageServer; runserver()",
]} |
That worked, thanks! |
This simplifies the setup for the Julia language server.
Also changes the standard indent to 4 spaces, which is recommended in the style guide.
https://docs.julialang.org/en/v1/manual/style-guide/#Indentation