Closed jeanp413 closed 2 years ago
May I know the use case? And what happens if user has auto update enabled?
@sandy081 I have an extension that reads a file where the user can specify extensions id (maybe with version specified) required for his workspace. My extension provides diagnostics and a quick action to install missing extensions using workbench.extensions.installExtension
command.
If the user has auto update enabled, then sure the extension will be updated, but this could be easily detected and show a notification teling the user if he's installing a specific version of an extension, he probably would want to disable auto update.
Also, the cli already supports installing a specific version of an extension with --install-extension
argument, so it would be good to have the same behavior for workbench.extensions.installExtension
Yes, one can install a specific version using CLI. But there is an open issue - that extension gets auto updated - this is due to the current limitation that storage is not accessible in CLI. We shall not surface the same here. So can you please update the PR to disable auto update when version is passed to the above command?
Here is the method that does that
You can make this as a service method that can be accessible from above command invocation.
vscode.commands.executeCommand('workbench.extensions.installExtension', 'christian-kohler.npm-intellisense@1.3.1');
works as expected!
Would be great if we can install a specific version of an extension using
workbench.extensions.installExtension