Repository navigation
Conversation
When a user opens a single Java file with no workspace folder, or a workspace folder with just a single Java file, show an information message recommending the JBang extension for running Java scripts. Includes option to install the jbang-vscode extension from the marketplace, and a 'Don't Show Again' option to suppress future notifications. Fixes redhat-developer#3111
| ); | ||
|
|
||
| if (choice === install) { | ||
| await commands.executeCommand(Commands.OPEN_BROWSER, Uri.parse(JBANG_MARKETPLACE_URL)); |
There was a problem hiding this comment.
It's possible to actually install the extension for the user instead of just opening the web browser to the website for the extension. The command for this is "workbench.extensions.installExtension" and it accepts the extension id as an argument.
It's also possible to open the extensions panel and enter the extension ID if you think that's too invasive. However, given the user's clicked "Install" I think it's fine to go ahead and install it.
There was a problem hiding this comment.
Agreed.
Change implemented:
In src/extension.ts, the "Install JBang" flow now directly installs the extension instead of opening a web browser:
// Before:
await commands.executeCommand(Commands.OPEN_BROWSER, Uri.parse(JBANG_MARKETPLACE_URL));
// After:
await commands.executeCommand('workbench.extensions.installExtension', JBANG_EXTENSION_ID);
Removed the now-unused JBANG_MARKETPLACE_URL constant.
Kept JBANG_EXTENSION_ID (jbangdev.jbang-vscode) and pass it as the argument to workbench.extensions.installExtension.
direct install command. Signed-off-by: Burhanuddin Vora <burhanuddin.vora@gmail.com>
When a user opens a single Java file with no workspace folder (standalone mode) or a workspace with just a single Java file, show an information message recommending the JBang extension for running Java scripts. Includes an "Install JBang" option that opens the jbang-vscode extension in the marketplace, and a "Don't Show Again" option to suppress future notifications.
Fixes #3111