-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Support version for installExtension, support uninstall cmd #14298
base: master
Are you sure you want to change the base?
Conversation
if (!id) { | ||
throw new Error(nls.localizeByDefault('Extension id required.')); | ||
} | ||
if (!PluginIdentifiers.isVersionedId(id)) { |
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 don't think this makes sense from a user's perspective: while technically, we can have multiple versions of the same plugin installed, that's not how it's presented to the user: for them, you either have a plugin installed, or not, independent of the version, so we should probably pass a naked id here.
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.
PluginServer.uninstall()
expects PluginIdentifiers.VersionedId
parameter which is typed as ${string}.${string}@${string}
that why it the code above makes sense to me.
that's not how it's presented to the user: for them, you either have a plugin installed, or not
The UNINSTALL_EXTENSION
command is not presented to the user, but is used in theia/packages/vsx-registry/src/browser/vsx-extension.tsx
where the versioned extension id is given.
I would prefer to keep require versioned id here.
packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts
Outdated
Show resolved
Hide resolved
@dhuebner still some open questions on this one. |
@tsmaeder |
f9a0ca7
to
ad3cd23
Compare
@tsmaeder |
ad3cd23
to
8001df6
Compare
@tsmaeder Ping |
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.
Hi Dennis, sorry for the delay, the last two releases have been somewhat crazy. Unfortunately, I still think this PR needs a bit of work.
Also, I don't really have a way to test the PR: when plugin API is involved and we don't have a known extension that exposes a plugin, we're making a little extension that exercises the API, in this case why not one that has two commands to install/uninstall with the user inputting a versioned id string?
8001df6
to
b7d7cd9
Compare
… of using a command.
No problem! Same here, a lot of TODOs :)
I've applied all the changes you suggested.
The simplest way to test is to add labels to the commands: export const INSTALL_FROM_VSIX: Command = {
id: 'workbench.extensions.installExtension',
label: nls.localizeByDefault('Install Extension')
};
export const UNINSTALL_EXTENSION: Command = {
id: 'workbench.extensions.uninstallExtension',
label: nls.localizeByDefault('Uninstall Extension')
}; And then defaults for commands.registerCommand(VscodeCommands.INSTALL_FROM_VSIX, {
execute: async (vsixUriOrExtensionId: TheiaURI | UriComponents | string = 'langium.langium-vscode') => { commands.registerCommand(VscodeCommands.UNINSTALL_EXTENSION, {
execute: async (id: string = '[email protected]') => { Use |
Btw. "Install Extension" user command would be a nice feature for Theia. Like shown here in Installation section. |
What it does
Allows to use version when executing
workbench.extensions.installExtension
command in format<extensionId>@<version>
#13795Adds support for
workbench.extensions.uninstallExtension
command #13796How to test
Run uninstall on some installed extension.
extension.uninstall
now uses the newworkbench.extensions.uninstallExtension
under the hood.Install command
workbench.extensions.installExtension
is currently not used in Theia with astring
parameter, one need to create a separate command.Follow-ups
Review checklist
Reminder for reviewers