Changed default Project Root when build.zig not found#5090
Changed default Project Root when build.zig not found#5090coffeebe4code wants to merge 1 commit intodense-analysis:masterfrom
Conversation
|
There are linter issues that need fixing: |
| return !empty(l:build_rs) ? fnamemodify(l:build_rs, ':h') : '' | ||
| return !empty(l:build_rs) | ||
| \ ? fnamemodify(l:build_rs, ':h') | ||
| \ : expand('#' . a:buffer . ':p:h') |
There was a problem hiding this comment.
The issue with doing this is that ALE will launch an instance of the language server per project root, so you could end up with a lot of duplicate instances being launched. Is there some other project file we can look for to find the root of a Zig project, possibly including the .git directory?
#4993 I'll also mention this idea I pitched. I'll come back to that and finish it eventually in the future if others don't. I would like if if we always used the ale_root` option for setting the root of a project and skipping all filesystem searching so the project root is always configurable, including for the Python project root.
|
I implemented the suggested change and rebased. I am going to need to understand how to run these lints myself if I get blocked by the linter again. |
updated tests
|
@coffeebe4code ALE comes with the custom linter so just enable it in your configuration and ALE will tell you about the linter errors: linters = {
vim = { "vint", "ale_custom_linting_rules" },
} |
Zig does not need a project root, but when viewing the std library, there is no build.zig. The current directory is fine for these purposes. zls remains quick on my linux machine.
Addresses this issue