Skip to content
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

workspace: add command mapping to plugin-system #10039

Merged
merged 1 commit into from
Sep 3, 2021
Merged

workspace: add command mapping to plugin-system #10039

merged 1 commit into from
Sep 3, 2021

Conversation

dineshUmasankar
Copy link
Contributor

What it does

Fixes: #9840

With the aid of @vince-fugnitto, Added the command workspace:openConfigFile mapping in the plugin system to be able to be executed by vscode plugins.
(vscode command id) workbench.action.openWorkspaceConfigFile

How to test

To test functionality, from @vince-fugnitto ,

@dineshUmasankar to test it is quite simple, I created a plugin to test which you can use since you were having difficulty:

The plugin simply executes the command:

export function activate(context: vscode.ExtensionContext) {
    let disposable = vscode.commands.registerCommand('vscode-open-config-file.test', () => {
        vscode.commands.executeCommand('workbench.action.openWorkspaceConfigFile');
    });

    context.subscriptions.push(disposable);
}

The command workbench.action.openWorkspaceConfigFile is available when we start the application, and we have a multi-root workspace opened (a workspace with more than one root folder, and described as a workspace file). In vscode this plugin will successfully work, but in the theia framework we need to make sure to add the proper mapping so that it is available by the plugin.

Error (theia):

Error: Command with id 'workbench.action.openWorkspaceConfigFile' is not registered.

To test the feature you would do the following:

  1. add the test plugin to the plugins/ folder
  2. start the application
  3. open a workspace
  4. use the command add folder to workspace (to add a secondary root and create a multi-root workspace)
  5. use the command test: open config file (the configuration file should open)

I confirmed it works locally with the plugin and the mapping updates:

Screen Shot 2021-08-31 at 9 50 08 PM

My confirmation of it working locally with the plugin and mapping updates:

testing-openWorkspaceConfigFile

Review checklist

Reminder for reviewers

Signed-off-by: dineshUmasankar dinesh71uma@gmail.com

Added the command workspace:openConfigFile mapping in the plugin system to be able to be executed by vscode plugins.
@dineshUmasankar
Copy link
Contributor Author

I opened up a new pull request, because I had accidentally made a rebase mistake and decided to redo from scratch and properly learn standard protocol. Thank you for guiding and providing me with the resources to contribute.

@vince-fugnitto vince-fugnitto added plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility labels Sep 2, 2021
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that the changes work successfully 👍 Thank you for your contribution!

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm as well that the change adresses the issue nicely.

@vince-fugnitto vince-fugnitto merged commit 068e78d into eclipse-theia:master Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

workspace: add command mapping to plugin-system
3 participants