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
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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!

execute: () => {
commands.executeCommand('monaco.editor.action.rename');
}
});
commands.registerCommand({ id: 'editor.action.formatSelection' }, {
execute: () => {
commands.executeCommand('monaco.editor.action.formatSelection');
}
});
commands.registerCommand({ id: 'editor.action.formatDocument' }, {
execute: () => {
commands.executeCommand('monaco.editor.action.formatDocument');
}
});
}

private getHtml(body: String) {
Expand Down