Overhaul extension binary distribution #767
Closed
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.
This PR overhauls the way the VSCode extension works in finding and using a stylua binary. It gets rid of the overhead of downloading from GitHub and updating the binary from time to time via a notifcation.
The stylua binary lookup works in the following order:
stylua.styluaPath
if specifiedstylua.useBinaryFromPath
is enabled (default: true)StyLua is commonly managed by other tools such as Aftman/Foreman, or a system installation. Step (2) means that we will use the same version that a user has on the command line to run stylua. This means the version will always remain in sync. Closes #527.
The extension version will now reflect the version of stylua bundled. Due to existing limitations, we will change the major version to use
1
instead of0
(as the vscode extension has already uploaded1.X.X
releases). So0.18.2
will map to extension version1.18.2
. Currently, there is confusion about what the extension versioned represented, and this alleviates that problem. Also, users can now downgrade/upgrade the extension version to determine the version of stylua they want.The extension will be released alongside new stylua releases. This has the added benefit that the extension will always be updated. Currently the process was manual, and often times I would forget to update the extension.
The extension
README
andCHANGELOG
will now also follow the equivalent main stylua README/CHANGELOG.We get rid of the following settings, as they have no use anymore:
stylua.releaseVersion
stylua.targetReleaseVersion
stylua.disableVersionCheck
Potential drawbacks:
.vscode/settings.json
with astylua.targetReleaseVersion
set. The bundled version is globally consistent. To resolve this, a toolchain manager will need to be used. This problem is consistent with other tools, such as prettier or black.TODO: this overhaul is currently blocked on LPGhatguy/aftman#54
TODO: update readme and changelog about this