Show next/previous commenting range in command palette (#193782)

This commit is contained in:
Alex Ross
2023-09-22 11:45:16 +02:00
committed by GitHub
parent 685987d23a
commit f4761fe652

View File

@@ -85,6 +85,15 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
weight: KeybindingWeight.EditorContrib weight: KeybindingWeight.EditorContrib
}); });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: CommentCommandId.NextRange,
title: nls.localize('comments.nextCommentingRange', "Go to Next Commenting Range"),
category: 'Comments',
},
when: CommentContextKeys.activeEditorHasCommentingRange
});
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: CommentCommandId.PreviousRange, id: CommentCommandId.PreviousRange,
handler: async (accessor, args?: { range: IRange; fileComment: boolean }) => { handler: async (accessor, args?: { range: IRange; fileComment: boolean }) => {
@@ -104,6 +113,15 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
weight: KeybindingWeight.EditorContrib weight: KeybindingWeight.EditorContrib
}); });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: CommentCommandId.PreviousRange,
title: nls.localize('comments.previousCommentingRange', "Go to Previous Commenting Range"),
category: 'Comments',
},
when: CommentContextKeys.activeEditorHasCommentingRange
});
CommandsRegistry.registerCommand({ CommandsRegistry.registerCommand({
id: CommentCommandId.ToggleCommenting, id: CommentCommandId.ToggleCommenting,
handler: (accessor) => { handler: (accessor) => {