Skip to content

Conversation

@Techatrix
Copy link
Collaborator

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.buildArgs and zig.zls.buildOnSaveArgs are unified into zig.buildOnSaveArgs
  • zig.buildOnSave and zig.zls.enableBuildOnSave are replaced with zig.buildOnSaveProvider
  • zig.buildFilePath has been removed. Add ["--build-file", "/path/to/build.zig"] to zig.buildOnSaveArgs instead.
  • zig.buildOption has been removed.

The zig.buildOnSaveProvider config 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:

  • the compiler output is inaccessible to the user except for error messages
  • it's no based on --watch so it can't take advantage of incremental compilation (until compiler state serialization has been implemented)

The new implementation will run zig build --watch as 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 #30

Closes #405
Closes #196

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.

"Build on Save" seems broken "Build workspace" provides no feedback

1 participant