-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
vsx: update compatibility check for builtins #9486
Conversation
The changeset updates the logic when getting the latest compatible version of a builtin extension (individual or pack) by fetching the version which is defined by api version supported by the framework. Since the `engines.vscode` property is generally not maintained by vscode builtin extensions (since they are bundled with vscode at a specific version) we cannot rely on the `engines.vscode` version to fetch a compatible extension. Instead, we now fetch a version which corresponds to the api level the framework defines. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
1379f80
to
d110811
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the behavior is as expected,
In addition to the suggested test, I did:
- bring the
VSCODE_DEFAULT_API_VERSION
down to as early as 1.44.2 works to select the proper versions from UI. - Installing a
builtin-extension-pack
from the registry at runtime works
Just a minor optimization as inline comment is pending.
You may want to clean this folder as well, specially if you tested installing the pack with the example app: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally: we pull appropriate versions of built-ins, individually at runtime and when installing the pack too. Thanks @vince-fugnitto !
I'll merge early next week if there are no objections, thank you for the reviews! |
Problem
The framework requires special logic when handling
builtin
extensions which are maintained by the project:vscode-builtin-extension
: builtin extensions which are bundled with vscodevscode-builtin-extension-packs
: builtin extension pack containing bundled vscode extensions referenced by id.The issue is that these such extensions do not necessarily maintain their
engines.vscode
field so instead we should be smarter and fetch compatible versions of these extensions by their actualversion
(which corresponds to the actual vscode version). This way, we are more likely to fetch a valid version of an extension which satisfies our API level.What it does
The changes include updating the logic to determine compatible versions of extensions:
project maintained builtins
(vscode): we check compatibility based onversion
.builtin
(non-vscode bundled extensions): we check compatibility based onengines.vscode
version.engines.vscode
version.The changes determine builtin compatibility by using
semver.lte
(less than or equal) in order to get a version which matches the API version, or a previous version to ensure that extensions are compatible.The changes also include the
VSXBuiltinNamespaces
namespace which contains information on reserved builtin namespaces:vscode
: reserved for individual vscode builtin extensions.eclipse-theia
: reserved for builtin extension-packs of individual vscode builtin extensions.How to test
rm -rf plugins/
,rm -rf /tmp/vscode-unpacked
,rm -rf ~/theia/extensions
).json-language-features
- the extension should be at1.50.0
(current API level).1.50.0
if it exists, else a previous version if it exists.Review checklist
Reminder for reviewers
Signed-off-by: vince-fugnitto vincent.fugnitto@ericsson.com