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

various version manager improvements #389

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Techatrix
Copy link
Collaborator

This PR applies three changes to the version manager. The changes correspond the first three commits.

offer to update workspace config files when selecting Zig version

fixes #247

Using the "Select and Install" popup to switch to a different Zig version will no longer be saved permanently. It will revert to the previous version after restarting VS Code. To make the change permanent, the version should be saved in a .zigversion, build.zig.zon or settings.json file. The extension will automatically suggest this change with a message. If not workspace config has been found, a .zigversion file will be created.

I am open to any better wording suggestions for the message. This is what I went for:

Screenshot From 2025-01-23 18-30-30

lookup Zig in the $PATH if no workspace version has been specified.

If the workspace specified no Zig version, the extension would automatically install the latest tagged release. This commit will try to lookup Zig in the $PATH before falling back to the latest tagged release. This is meant to avoid confusing users why their already installed Zig version is not being used.

override the $PATH in the integrated terminal

Previously, if the $PATH has a zig version, the integrated terminal would prefer it over the version that is used by the version manager. Thanks to the previous commit, it now makes more sense to override the $PATH. This means that the integrated terminal will use the Zig version requested by the workspace even if the user added Zig to the $PATH.

Copy link
Member

@Vexu Vexu left a comment

Choose a reason for hiding this comment

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

LGTM!

I don't have a better idea for the message but asking to "save Zig version in this workspace" when not in a workspace seems strange. Maybe it should have a more specific message or just save the version in settings without asking since workspaces can override it.

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.

selecting a Zig version should offer to update .zigversion or build.zig.zon
2 participants