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

fix(zls): include build.zig in root dir search #2933

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

lawrence-laz
Copy link
Contributor

File build.zig by convention sits at the root dir and thus can be used to correctly identify the root directory.

This is particularly useful if zls has enable_build_on_save set to true, since then the language server uses workspace path (root_dir) to execute zig build command, output of which is then used to publish diagnostic errors.

Without build.zig root directory can incorrectly be deduced some layers too high at the root of the git repo. In such case enable_build_on_save silently fails and does not report build error diagnostics.

Copy link
Contributor

Do not change server_configurations.md directly. Edit the lua source file instead. See https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#generating-docs

File `build.zig` by convention sits at the root dir and thus can be used
to correctly identify the root directory.

This is particularly useful if `zls` has `enable_build_on_save` set to
`true`, since then the language server uses workspace path (root_dir) to
execute `zig build` command, output of which is then used to publish
diagnostic errors.

Without `build.zig` root directory can incorrectly be deduced some
layers too high at the root of the git repo. In such case
`enable_build_on_save` silently fails and does not report build error
diagnostics.
@lawrence-laz lawrence-laz changed the title fix(zls): inclide build.zig in root dir search fix(zls): include build.zig in root dir search Dec 18, 2023
@glepnir glepnir merged commit dbfafca into neovim:master Dec 18, 2023
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants