replace extension based build on save and unify config options with ZLS #466
+291
−249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The extension currently provides two separate "build on save" implementations. One provided by the extension itself and another by the ZLS language server. The existing configuration options do not clearly indicate that these are independent features, which can cause confusion and misconfiguration from users.
To make it easier for users to understand how to configure build on save when looking at the available config options in VS Code, this PR adjusts them like this:
zig.buildArgsandzig.zls.buildOnSaveArgsare unified intozig.buildOnSaveArgszig.buildOnSaveandzig.zls.enableBuildOnSaveare replaced withzig.buildOnSaveProviderzig.buildFilePathhas been removed. Add["--build-file", "/path/to/build.zig"]tozig.buildOnSaveArgsinstead.zig.buildOptionhas been removed.The
zig.buildOnSaveProviderconfig option prevents users from enabling both build on save implementations at the same time.This PR also replaces the current build on save implementation of the extension to address the following issues:
--watchso it can't take advantage of incremental compilation (until compiler state serialization has been implemented)The new implementation will run
zig build --watchas VS Code Tasks in a separate integrated terminal and automatically parse out error messages. In the future, the extension could also implement a Task Provider to let users further customize how the compiler should be invoked. Related #30Closes #405
Closes #196