-
Notifications
You must be signed in to change notification settings - Fork 57
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
introduce a fully featured version manager #230
Draft
Techatrix
wants to merge
29
commits into
master
Choose a base branch
from
techatrix/version-manager
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+1,160
−572
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These changes make ZLS an "invisible" component of the extension after the initial setup. This also removes the `zig.zls.checkForUpdate` command. I am not sure if it even needs to be brought back. I've made sure that no error is reported if no internet connection is available. The last installed ZLS version should be reused. closes #136 because `zig.zls.startRestart` will just enable ZLS instead of complaining
See the TODOs on what needs to be added to the VersionManager fixes #111
This commit replaces the initial setup with the following mechanism: 1. If the workspace contains a `.zigversion`, install the given Zig version. 2. If the workspace contains a `build.zig.zon` with a `minimum_zig_version`, install the next available Zig version. 3. Check if the "Install Zig" has been previously executed in the active workspace. If so, install that version. 3. Otherwise fallback to the latest tagged release of Zig. Some parts of this are not fully implemented. fixes #111
The version in `minimum_zig_version` may not be available. We need to find the "closest satisfactory" Zig version that is provided by zigtools.org. This is not yet implemented.
This also disallows overriding the `zig.path` and `zig.zls.path` in a workspace. A workspace should never contain setting that are not transferable across different machines.
Also fixes the "`zig.path` should be unset here right?" TODO.
This makes it usable without an internet connection.
This unfortunately has a large relative impact on the bundle size: 600kb -> 1.3mb
The version is still being checked if `zig.path` is set. This means that the extension is not usable with these old versions.
@Vexu Any thoughts on these changes? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Installing Zig or ZLS with the extension doesn't properly handle switching between different Zig project.
You have to manually figure out which version to get and install it every time your switch to a project that requires a different Zig version. Same goes for ZLS. The vscode configuration for Zig also can't handle switching between devices (see #111)
Let's stop giving developer the ability to misconfigure their editor.
Version Manager
This is how the extension selects which version of Zig to install:
zig.version
config option (can be global or per-workspace)minimum_zig_version
inbuild.zig
of your workspace.zigversion
to your workspace which stores the desired Zig versionIf none of the above apply, the latest tagged release of Zig is installed.
Installs are automatically uninstalled to not fill up disk storage too much.
Installs are verified with minisign
The version of ZLS is inferred from the Zig version.
Status Bar
Hovering over the "Editor Language Status" will show whether Zig and ZLS are installed + their versions. The Status Bar Item for Zig will turn red if is not installed. Clicking on it will open the 'Select and Install' popup.
Updated 'Select and Install' popup
Remaining issues
build.zig.zon
is not working properly. see this TODO.zig.checkForUpdate
config option and update command have been removed. It should be added back but with some adjustments.I wanted to keep these changes as small as possible but I couldn't stop myself. 😞
Any feedback would be greatly appreciated.