@codingame/monaco-vscode-comments-service-override 10.1.4 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-comments-service-override",
3
- "version": "10.1.4",
3
+ "version": "11.0.1",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,8 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@10.1.4"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@11.0.1",
30
+ "@codingame/monaco-vscode-comments-extensions-common": "11.0.1",
31
+ "@codingame/monaco-vscode-chat-comments-extensions-interactive-notebook-search-common": "11.0.1"
30
32
  }
31
33
  }
@@ -7,12 +7,12 @@ import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
7
7
  import { CommentMenus } from './commentMenus.js';
8
8
  import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
9
9
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
10
- import { COMMENTS_SECTION } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentsConfiguration';
10
+ import { COMMENTS_SECTION } from '@codingame/monaco-vscode-chat-comments-extensions-interactive-notebook-search-common/vscode/vs/workbench/contrib/comments/common/commentsConfiguration';
11
11
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
12
12
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
13
13
  import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentContextKeys';
14
14
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
15
- import { CommentsModel } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsModel';
15
+ import { CommentsModel } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsModel';
16
16
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
17
17
 
18
18
  const CONTINUE_ON_COMMENTS = 'comments.continueOnComments';
@@ -10,15 +10,15 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
10
10
  import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
11
11
  import { NumberBadge } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
12
12
  import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity.service';
13
- import { COMMENTS_VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
13
+ import { COMMENTS_VIEW_ID } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
14
14
  import { CommentThreadState } from 'vscode/vscode/vs/editor/common/languages';
15
15
  import { registerAction2, MenuId, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
16
- import { CONTEXT_KEY_HAS_COMMENTS, CONTEXT_KEY_SOME_COMMENTS_EXPANDED } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsView';
16
+ import { CONTEXT_KEY_HAS_COMMENTS, CONTEXT_KEY_SOME_COMMENTS_EXPANDED } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsView';
17
17
  import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
18
18
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
19
19
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
20
20
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
21
- import { revealCommentThread } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsController';
21
+ import { revealCommentThread } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
22
22
  import { accessibleViewIsShown, accessibleViewCurrentProviderId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
23
23
  import { AccessibleViewRegistry } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleViewRegistry';
24
24
  import { CommentsAccessibleView, CommentThreadAccessibleView } from './commentsAccessibleView.js';
@@ -29,7 +29,7 @@ registerAction2(class Collapse extends ViewAction {
29
29
  super({
30
30
  viewId: COMMENTS_VIEW_ID,
31
31
  id: 'comments.collapse',
32
- title: ( localize(2141, "Collapse All")),
32
+ title: ( localize(2138, "Collapse All")),
33
33
  f1: false,
34
34
  icon: Codicon.collapseAll,
35
35
  menu: {
@@ -52,7 +52,7 @@ registerAction2(class Expand extends ViewAction {
52
52
  super({
53
53
  viewId: COMMENTS_VIEW_ID,
54
54
  id: 'comments.expand',
55
- title: ( localize(2142, "Expand All")),
55
+ title: ( localize(2139, "Expand All")),
56
56
  f1: false,
57
57
  icon: Codicon.expandAll,
58
58
  menu: {
@@ -74,7 +74,7 @@ registerAction2(class Reply extends Action2 {
74
74
  constructor() {
75
75
  super({
76
76
  id: 'comments.reply',
77
- title: ( localize(2143, "Reply")),
77
+ title: ( localize(2140, "Reply")),
78
78
  icon: Codicon.reply,
79
79
  precondition: ( (ContextKeyExpr.equals('canReply', true))),
80
80
  menu: [{
@@ -100,34 +100,34 @@ registerAction2(class Reply extends Action2 {
100
100
  ( (Registry.as(Extensions.Configuration))).registerConfiguration({
101
101
  id: 'comments',
102
102
  order: 20,
103
- title: ( localize(2144, "Comments")),
103
+ title: ( localize(2141, "Comments")),
104
104
  type: 'object',
105
105
  properties: {
106
106
  'comments.openPanel': {
107
107
  enum: ['neverOpen', 'openOnSessionStart', 'openOnSessionStartWithComments'],
108
108
  default: 'openOnSessionStartWithComments',
109
- description: ( localize(2145, "Controls when the comments panel should open.")),
109
+ description: ( localize(2142, "Controls when the comments panel should open.")),
110
110
  restricted: false,
111
- markdownDeprecationMessage: ( localize(2146, "This setting is deprecated in favor of `comments.openView`."))
111
+ markdownDeprecationMessage: ( localize(2143, "This setting is deprecated in favor of `comments.openView`."))
112
112
  },
113
113
  'comments.openView': {
114
114
  enum: ['never', 'file', 'firstFile', 'firstFileUnresolved'],
115
- enumDescriptions: [( localize(2147, "The comments view will never be opened.")), ( localize(2148, "The comments view will open when a file with comments is active.")), ( localize(
116
- 2149,
115
+ enumDescriptions: [( localize(2144, "The comments view will never be opened.")), ( localize(2145, "The comments view will open when a file with comments is active.")), ( localize(
116
+ 2146,
117
117
  "If the comments view has not been opened yet during this session it will open the first time during a session that a file with comments is active."
118
118
  )), ( localize(
119
- 2150,
119
+ 2147,
120
120
  "If the comments view has not been opened yet during this session and the comment is not resolved, it will open the first time during a session that a file with comments is active."
121
121
  ))],
122
122
  default: 'firstFile',
123
- description: ( localize(2151, "Controls when the comments view should open.")),
123
+ description: ( localize(2148, "Controls when the comments view should open.")),
124
124
  restricted: false
125
125
  },
126
126
  'comments.useRelativeTime': {
127
127
  type: 'boolean',
128
128
  default: true,
129
129
  description: ( localize(
130
- 2152,
130
+ 2149,
131
131
  "Determines if relative time will be used in comment timestamps (ex. '1 day ago')."
132
132
  ))
133
133
  },
@@ -135,20 +135,20 @@ registerAction2(class Reply extends Action2 {
135
135
  type: 'boolean',
136
136
  default: true,
137
137
  description: ( localize(
138
- 2153,
138
+ 2150,
139
139
  "Controls the visibility of the comments bar and comment threads in editors that have commenting ranges and comments. Comments are still accessible via the Comments view and will cause commenting to be toggled on in the same way running the command \"Comments: Toggle Editor Commenting\" toggles comments."
140
140
  ))
141
141
  },
142
142
  'comments.maxHeight': {
143
143
  type: 'boolean',
144
144
  default: true,
145
- description: ( localize(2154, "Controls whether the comments widget scrolls or expands."))
145
+ description: ( localize(2151, "Controls whether the comments widget scrolls or expands."))
146
146
  },
147
147
  'comments.collapseOnResolve': {
148
148
  type: 'boolean',
149
149
  default: true,
150
150
  description: ( localize(
151
- 2155,
151
+ 2152,
152
152
  "Controls whether the comment thread should collapse when the thread is resolved."
153
153
  ))
154
154
  }
@@ -189,7 +189,7 @@ let UnresolvedCommentsBadge = class UnresolvedCommentsBadge extends Disposable {
189
189
  return;
190
190
  }
191
191
  this.totalUnresolved = unresolved;
192
- const message = ( localize(2156, '{0} Unresolved Comments', this.totalUnresolved));
192
+ const message = ( localize(2153, '{0} Unresolved Comments', this.totalUnresolved));
193
193
  this.activity.value = this.activityService.showViewActivity(COMMENTS_VIEW_ID, { badge: ( (new NumberBadge(this.totalUnresolved, () => message))) });
194
194
  }
195
195
  };
@@ -2,12 +2,12 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
3
  import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
4
4
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
5
- import { COMMENTS_VIEW_ID, CommentsMenus } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
6
- import { CONTEXT_KEY_COMMENT_FOCUSED } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsView';
5
+ import { COMMENTS_VIEW_ID, CommentsMenus } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
6
+ import { CONTEXT_KEY_COMMENT_FOCUSED } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsView';
7
7
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
8
8
  import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service';
9
9
  import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentContextKeys';
10
- import { revealCommentThread, moveToNextCommentInThread } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsController';
10
+ import { revealCommentThread, moveToNextCommentInThread } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
11
11
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
12
12
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
13
13
  import { isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
@@ -1,17 +1,16 @@
1
1
  import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
2
- import 'vscode/vscode/vs/workbench/contrib/comments/browser/media/review.css';
2
+ import '@codingame/monaco-vscode-chat-comments-extensions-interactive-notebook-search-common/vscode/vs/workbench/contrib/comments/browser/media/review.css';
3
3
  import { isDiffEditor, isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
4
4
  import { registerEditorContribution } from 'vscode/vscode/vs/editor/browser/editorExtensions';
5
5
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
6
6
  import { localize } from 'vscode/vscode/vs/nls';
7
- import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
8
7
  import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
9
8
  import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService.service';
10
9
  import { ctxCommentEditorFocused, SimpleCommentEditor } from 'vscode/vscode/vs/workbench/contrib/comments/browser/simpleCommentEditor';
11
10
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
12
- import { registerAction2, Action2, MenuRegistry, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
11
+ import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
13
12
  import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
14
- import { ID, CommentController } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsController';
13
+ import { ID, CommentController } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentsController';
15
14
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
16
15
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
17
16
  import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/common/commentContextKeys';
@@ -20,7 +19,7 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
20
19
  import { accessibilityHelpIsShown, accessibleViewCurrentProviderId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
21
20
  import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
22
21
  import { CommentsInputContentProvider } from './commentsInputContentProvider.js';
23
- import { CommentWidgetFocus } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentThreadZoneWidget';
22
+ import { CommentWidgetFocus } from '@codingame/monaco-vscode-comments-extensions-common/vscode/vs/workbench/contrib/comments/browser/commentThreadZoneWidget';
24
23
 
25
24
  registerEditorContribution(ID, CommentController, 1 );
26
25
  registerWorkbenchContribution2(CommentsInputContentProvider.ID, CommentsInputContentProvider, 2 );
@@ -61,14 +60,17 @@ registerAction2(class extends Action2 {
61
60
  super({
62
61
  id: "editor.action.nextCommentedRangeAction" ,
63
62
  title: {
64
- value: ( localize(5309, "Go to Next Commented Range")),
63
+ value: ( localize(5335, "Go to Next Commented Range")),
65
64
  original: 'Go to Next Commented Range'
66
65
  },
67
66
  category: {
68
- value: ( localize(5310, "Comments")),
67
+ value: ( localize(5336, "Comments")),
69
68
  original: 'Comments'
70
69
  },
71
- f1: true,
70
+ menu: [{
71
+ id: MenuId.CommandPalette,
72
+ when: CommentContextKeys.activeEditorHasCommentingRange
73
+ }],
72
74
  keybinding: {
73
75
  primary: 512 | 68 ,
74
76
  weight: 100 ,
@@ -93,14 +95,17 @@ registerAction2(class extends Action2 {
93
95
  super({
94
96
  id: "editor.action.previousCommentedRangeAction" ,
95
97
  title: {
96
- value: ( localize(5311, "Go to Previous Commented Range")),
98
+ value: ( localize(5337, "Go to Previous Commented Range")),
97
99
  original: 'Go to Previous Commented Range'
98
100
  },
99
101
  category: {
100
- value: ( localize(5310, "Comments")),
102
+ value: ( localize(5336, "Comments")),
101
103
  original: 'Comments'
102
104
  },
103
- f1: true,
105
+ menu: [{
106
+ id: MenuId.CommandPalette,
107
+ when: CommentContextKeys.activeEditorHasCommentingRange
108
+ }],
104
109
  keybinding: {
105
110
  primary: 1024 | 512 | 68 ,
106
111
  weight: 100 ,
@@ -120,96 +125,145 @@ registerAction2(class extends Action2 {
120
125
  controller.previousCommentThread(false);
121
126
  }
122
127
  });
123
- KeybindingsRegistry.registerCommandAndKeybindingRule({
124
- id: "editor.action.nextCommentingRange" ,
125
- handler: async (accessor, args) => {
128
+ registerAction2(class extends Action2 {
129
+ constructor() {
130
+ super({
131
+ id: "editor.action.nextCommentingRange" ,
132
+ title: {
133
+ value: ( localize(5338, "Go to Next Commenting Range")),
134
+ original: 'Go to Next Commenting Range'
135
+ },
136
+ category: {
137
+ value: ( localize(5336, "Comments")),
138
+ original: 'Comments'
139
+ },
140
+ menu: [{
141
+ id: MenuId.CommandPalette,
142
+ when: CommentContextKeys.activeEditorHasCommentingRange
143
+ }],
144
+ keybinding: {
145
+ primary: KeyChord(2048 | 41 , 2048 | 512 | 18 ),
146
+ weight: 100 ,
147
+ when: ( (ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, (ContextKeyExpr.or(
148
+ EditorContextKeys.focus,
149
+ CommentContextKeys.commentFocused,
150
+ (ContextKeyExpr.and(
151
+ accessibilityHelpIsShown,
152
+ (accessibleViewCurrentProviderId.isEqualTo("comments" ))
153
+ ))
154
+ )))))
155
+ }
156
+ });
157
+ }
158
+ run(accessor, args) {
126
159
  const activeEditor = getActiveEditor(accessor);
127
160
  if (!activeEditor) {
128
- return Promise.resolve();
161
+ return;
129
162
  }
130
163
  const controller = CommentController.get(activeEditor);
131
164
  if (!controller) {
132
- return Promise.resolve();
165
+ return;
133
166
  }
134
167
  controller.nextCommentingRange();
135
- },
136
- when: ( (ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, (ContextKeyExpr.or(
137
- EditorContextKeys.focus,
138
- CommentContextKeys.commentFocused,
139
- (ContextKeyExpr.and(
140
- accessibilityHelpIsShown,
141
- (accessibleViewCurrentProviderId.isEqualTo("comments" ))
142
- ))
143
- ))))),
144
- primary: KeyChord(2048 | 41 , 2048 | 512 | 18 ),
145
- weight: 100
146
- });
147
- MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
148
- command: {
149
- id: "editor.action.nextCommentingRange" ,
150
- title: ( localize(5312, "Go to Next Commenting Range")),
151
- category: 'Comments',
152
- },
153
- when: CommentContextKeys.activeEditorHasCommentingRange
168
+ }
154
169
  });
155
- KeybindingsRegistry.registerCommandAndKeybindingRule({
156
- id: "editor.action.previousCommentingRange" ,
157
- handler: async (accessor, args) => {
170
+ registerAction2(class extends Action2 {
171
+ constructor() {
172
+ super({
173
+ id: "editor.action.previousCommentingRange" ,
174
+ title: {
175
+ value: ( localize(5339, "Go to Previous Commenting Range")),
176
+ original: 'Go to Previous Commenting Range'
177
+ },
178
+ category: {
179
+ value: ( localize(5336, "Comments")),
180
+ original: 'Comments'
181
+ },
182
+ menu: [{
183
+ id: MenuId.CommandPalette,
184
+ when: CommentContextKeys.activeEditorHasCommentingRange
185
+ }],
186
+ keybinding: {
187
+ primary: KeyChord(2048 | 41 , 2048 | 512 | 16 ),
188
+ weight: 100 ,
189
+ when: ( (ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, (ContextKeyExpr.or(
190
+ EditorContextKeys.focus,
191
+ CommentContextKeys.commentFocused,
192
+ (ContextKeyExpr.and(
193
+ accessibilityHelpIsShown,
194
+ (accessibleViewCurrentProviderId.isEqualTo("comments" ))
195
+ ))
196
+ )))))
197
+ }
198
+ });
199
+ }
200
+ async run(accessor, ...args) {
158
201
  const activeEditor = getActiveEditor(accessor);
159
202
  if (!activeEditor) {
160
- return Promise.resolve();
203
+ return;
161
204
  }
162
205
  const controller = CommentController.get(activeEditor);
163
206
  if (!controller) {
164
- return Promise.resolve();
207
+ return;
165
208
  }
166
209
  controller.previousCommentingRange();
167
- },
168
- when: ( (ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, (ContextKeyExpr.or(
169
- EditorContextKeys.focus,
170
- CommentContextKeys.commentFocused,
171
- (ContextKeyExpr.and(
172
- accessibilityHelpIsShown,
173
- (accessibleViewCurrentProviderId.isEqualTo("comments" ))
174
- ))
175
- ))))),
176
- primary: KeyChord(2048 | 41 , 2048 | 512 | 16 ),
177
- weight: 100
178
- });
179
- MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
180
- command: {
181
- id: "editor.action.previousCommentingRange" ,
182
- title: ( localize(5313, "Go to Previous Commenting Range")),
183
- category: 'Comments',
184
- },
185
- when: CommentContextKeys.activeEditorHasCommentingRange
210
+ }
186
211
  });
187
- CommandsRegistry.registerCommand({
188
- id: "workbench.action.toggleCommenting" ,
189
- handler: (accessor) => {
212
+ registerAction2(class extends Action2 {
213
+ constructor() {
214
+ super({
215
+ id: "workbench.action.toggleCommenting" ,
216
+ title: {
217
+ value: ( localize(5340, "Toggle Editor Commenting")),
218
+ original: 'Toggle Editor Commenting'
219
+ },
220
+ category: {
221
+ value: ( localize(5336, "Comments")),
222
+ original: 'Comments'
223
+ },
224
+ menu: [{
225
+ id: MenuId.CommandPalette,
226
+ when: CommentContextKeys.WorkspaceHasCommenting
227
+ }]
228
+ });
229
+ }
230
+ run(accessor, ...args) {
190
231
  const commentService = accessor.get(ICommentService);
191
232
  const enable = commentService.isCommentingEnabled;
192
233
  commentService.enableCommenting(!enable);
193
234
  }
194
235
  });
195
- MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
196
- command: {
197
- id: "workbench.action.toggleCommenting" ,
198
- title: ( localize(5314, "Toggle Editor Commenting")),
199
- category: 'Comments',
200
- },
201
- when: CommentContextKeys.WorkspaceHasCommenting
202
- });
203
- KeybindingsRegistry.registerCommandAndKeybindingRule({
204
- id: "workbench.action.addComment" ,
205
- handler: async (accessor, args) => {
236
+ registerAction2(class extends Action2 {
237
+ constructor() {
238
+ super({
239
+ id: "workbench.action.addComment" ,
240
+ title: {
241
+ value: ( localize(5341, "Add Comment on Current Selection")),
242
+ original: 'Add Comment on Current Selection'
243
+ },
244
+ category: {
245
+ value: ( localize(5336, "Comments")),
246
+ original: 'Comments'
247
+ },
248
+ menu: [{
249
+ id: MenuId.CommandPalette,
250
+ when: CommentContextKeys.activeCursorHasCommentingRange
251
+ }],
252
+ keybinding: {
253
+ primary: KeyChord(2048 | 41 , 2048 | 512 | 33 ),
254
+ weight: 100 ,
255
+ when: CommentContextKeys.activeCursorHasCommentingRange
256
+ }
257
+ });
258
+ }
259
+ async run(accessor, args) {
206
260
  const activeEditor = getActiveEditor(accessor);
207
261
  if (!activeEditor) {
208
- return Promise.resolve();
262
+ return;
209
263
  }
210
264
  const controller = CommentController.get(activeEditor);
211
265
  if (!controller) {
212
- return Promise.resolve();
266
+ return;
213
267
  }
214
268
  const position = args?.range ? ( (new Range(
215
269
  args.range.startLineNumber,
@@ -223,30 +277,20 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
223
277
  await controller.addOrToggleCommentAtLine(position, undefined);
224
278
  }
225
279
  catch (e) {
226
- notificationService.error(( localize(5315, "The cursor must be within a commenting range to add a comment")));
280
+ notificationService.error(( localize(5342, "The cursor must be within a commenting range to add a comment")));
227
281
  }
228
- },
229
- weight: 100 ,
230
- primary: KeyChord(2048 | 41 , 2048 | 512 | 33 ),
231
- });
232
- MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
233
- command: {
234
- id: "workbench.action.addComment" ,
235
- title: ( localize(5316, "Add Comment on Current Selection")),
236
- category: 'Comments'
237
- },
238
- when: CommentContextKeys.activeCursorHasCommentingRange
282
+ }
239
283
  });
240
284
  registerAction2(class extends Action2 {
241
285
  constructor() {
242
286
  super({
243
287
  id: "workbench.action.focusCommentOnCurrentLine" ,
244
288
  title: {
245
- value: ( localize(5317, "Focus Comment on Current Line")),
289
+ value: ( localize(5343, "Focus Comment on Current Line")),
246
290
  original: 'Focus Comment on Current Line'
247
291
  },
248
292
  category: {
249
- value: ( localize(5310, "Comments")),
293
+ value: ( localize(5336, "Comments")),
250
294
  original: 'Comments'
251
295
  },
252
296
  f1: true,
@@ -278,51 +322,75 @@ registerAction2(class extends Action2 {
278
322
  error = true;
279
323
  }
280
324
  if (error) {
281
- notificationService.error(( localize(5318, "The cursor must be on a line with a comment to focus the comment")));
325
+ notificationService.error(( localize(5344, "The cursor must be on a line with a comment to focus the comment")));
282
326
  }
283
327
  }
284
328
  });
285
- CommandsRegistry.registerCommand({
286
- id: "workbench.action.collapseAllComments" ,
287
- handler: (accessor) => {
288
- return getActiveController(accessor)?.collapseAll();
329
+ registerAction2(class extends Action2 {
330
+ constructor() {
331
+ super({
332
+ id: "workbench.action.collapseAllComments" ,
333
+ title: {
334
+ value: ( localize(5345, "Collapse All Comments")),
335
+ original: 'Collapse All Comments'
336
+ },
337
+ category: {
338
+ value: ( localize(5336, "Comments")),
339
+ original: 'Comments'
340
+ },
341
+ menu: [{
342
+ id: MenuId.CommandPalette,
343
+ when: CommentContextKeys.WorkspaceHasCommenting
344
+ }]
345
+ });
289
346
  }
290
- });
291
- MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
292
- command: {
293
- id: "workbench.action.collapseAllComments" ,
294
- title: ( localize(5319, "Collapse All Comments")),
295
- category: 'Comments'
296
- },
297
- when: CommentContextKeys.WorkspaceHasCommenting
298
- });
299
- CommandsRegistry.registerCommand({
300
- id: "workbench.action.expandAllComments" ,
301
- handler: (accessor) => {
302
- return getActiveController(accessor)?.expandAll();
347
+ run(accessor, ...args) {
348
+ getActiveController(accessor)?.collapseAll();
303
349
  }
304
350
  });
305
- MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
306
- command: {
307
- id: "workbench.action.expandAllComments" ,
308
- title: ( localize(5320, "Expand All Comments")),
309
- category: 'Comments'
310
- },
311
- when: CommentContextKeys.WorkspaceHasCommenting
312
- });
313
- CommandsRegistry.registerCommand({
314
- id: "workbench.action.expandUnresolvedComments" ,
315
- handler: (accessor) => {
316
- return getActiveController(accessor)?.expandUnresolved();
351
+ registerAction2(class extends Action2 {
352
+ constructor() {
353
+ super({
354
+ id: "workbench.action.expandAllComments" ,
355
+ title: {
356
+ value: ( localize(5346, "Expand All Comments")),
357
+ original: 'Expand All Comments'
358
+ },
359
+ category: {
360
+ value: ( localize(5336, "Comments")),
361
+ original: 'Comments'
362
+ },
363
+ menu: [{
364
+ id: MenuId.CommandPalette,
365
+ when: CommentContextKeys.WorkspaceHasCommenting
366
+ }]
367
+ });
368
+ }
369
+ run(accessor, ...args) {
370
+ getActiveController(accessor)?.expandAll();
317
371
  }
318
372
  });
319
- MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
320
- command: {
321
- id: "workbench.action.expandUnresolvedComments" ,
322
- title: ( localize(5321, "Expand Unresolved Comments")),
323
- category: 'Comments'
324
- },
325
- when: CommentContextKeys.WorkspaceHasCommenting
373
+ registerAction2(class extends Action2 {
374
+ constructor() {
375
+ super({
376
+ id: "workbench.action.expandUnresolvedComments" ,
377
+ title: {
378
+ value: ( localize(5347, "Expand Unresolved Comments")),
379
+ original: 'Expand Unresolved Comments'
380
+ },
381
+ category: {
382
+ value: ( localize(5336, "Comments")),
383
+ original: 'Comments'
384
+ },
385
+ menu: [{
386
+ id: MenuId.CommandPalette,
387
+ when: CommentContextKeys.WorkspaceHasCommenting
388
+ }]
389
+ });
390
+ }
391
+ run(accessor, ...args) {
392
+ getActiveController(accessor)?.expandUnresolved();
393
+ }
326
394
  });
327
395
  KeybindingsRegistry.registerCommandAndKeybindingRule({
328
396
  id: "editor.action.submitComment" ,