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

Implementation of some editor.action commands needed for plugin API #5222

Closed
wants to merge 3 commits into from

Conversation

JPinkney
Copy link
Contributor

@JPinkney JPinkney commented May 22, 2019

Signed-off-by: Josh Pinkney joshpinkney@gmail.com

This PR makes 'editor.action.rename', 'editor.action.formatSelection', 'editor.action.formatDocument' available.

Related issue: eclipse-che/che#13007, #5215, #5216

Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@@ -309,6 +309,22 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
* Show Opened File in New Window workbench.action.files.showOpenedFileInNewWindow
* Compare Opened File With workbench.files.action.compareFileWith
*/

commands.registerCommand({ id: 'editor.action.rename' }, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@benoitf Fixed. I wasn't exactly sure where to define the commands so I defined them with the editor commands. If they should be somewhere else let me know!

Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@akosyakov
Copy link
Member

akosyakov commented May 27, 2019

We have a PR to expose monaco editor commands: https://github.com/theia-ide/theia/pull/4275/files#diff-50091b54c279f7fa9bf0acce18541c06R243 But decided against doing it in the editor extension: #4275 (comment)

I would rather go with #4275 if we are fine with supporting only subset of commands. cc @svenefftinge

@JPinkney
Copy link
Contributor Author

@akosyakov That looks like a much better solution and gives us a lot more commands. For keybindings coming from VSCode keybinding plugins they all use something like 'editor.action.formatSelection' [1] rather than 'monaco.editor.action.formatSelection' which means almost all of the keybindings won't register.

[1] - https://github.com/alphabotsec/vscode-eclipse-keybindings/blob/master/package.json#L178

@JPinkney JPinkney closed this May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants