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

simplify Julia config #1811

Merged
merged 3 commits into from
Mar 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -464,21 +464,13 @@ file-types = ["jl"]
roots = []
comment-token = "#"
language-server = { command = "julia", args = [
"--startup-file=no",
"--history-file=no",
"--quiet",
"-e",
"""
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);
""",
Comment on lines -471 to -479
Copy link
Member

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

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

@ChrHorn ChrHorn Mar 14, 2022

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good then 👍🏻

] }
indent = { tab-width = 2, unit = " " }
"--startup-file=no",
"--history-file=no",
"--quiet",
"-e",
"using LanguageServer; runserver()",
] }
indent = { tab-width = 4, unit = " " }

[[grammar]]
name = "julia"
Expand Down