@codingame/monaco-vscode-search-service-override 2.2.2 → 3.0.0

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.
@@ -1,8 +1,8 @@
1
1
  import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
+ import { localize2WithPath } from 'vscode/vscode/vs/nls';
3
3
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
4
4
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
5
- import { ToggleQueryDetailsActionId, SearchViewFocusedKey, CloseReplaceWidgetActionId, SearchViewVisibleKey, ReplaceInputBoxFocusedKey, ToggleCaseSensitiveCommandId, FileMatchOrFolderMatchFocusKey, ToggleWholeWordCommandId, ToggleRegexCommandId, TogglePreserveCaseId, OpenMatch, FileMatchOrMatchFocusKey, OpenMatchToSide, AddCursorsAtSearchResults, FocusNextInputActionId, InputBoxFocusedKey, FocusPreviousInputActionId, SearchInputBoxFocusedKey, FocusSearchFromResults, FirstMatchFocusKey, ToggleSearchOnTypeActionId, FocusSearchListCommandID, FocusNextSearchResultActionId, HasSearchResults, FocusPreviousSearchResultActionId, ReplaceInFilesActionId } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
5
+ import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
6
6
  import { InSearchEditor } from 'vscode/vscode/vs/workbench/contrib/searchEditor/browser/constants';
7
7
  import { FolderMatch } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
8
8
  import { SearchEditorInput } from '../../searchEditor/browser/searchEditorInput.js';
@@ -18,19 +18,19 @@ import { getActiveElement } from 'vscode/vscode/vs/base/browser/dom';
18
18
  registerAction2(class ToggleQueryDetailsAction extends Action2 {
19
19
  constructor() {
20
20
  super({
21
- id: ToggleQueryDetailsActionId,
22
- title: {
23
- value: ( localizeWithPath(
24
- 'vs/workbench/contrib/search/browser/searchActionsNav',
25
- 'ToggleQueryDetailsAction.label',
26
- "Toggle Query Details"
27
- )),
28
- original: 'Toggle Query Details'
29
- },
21
+ id: "workbench.action.search.toggleQueryDetails" ,
22
+ title: ( localize2WithPath(
23
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
24
+ 'ToggleQueryDetailsAction.label',
25
+ "Toggle Query Details"
26
+ )),
30
27
  category,
31
28
  keybinding: {
32
29
  weight: 200 ,
33
- when: ( ContextKeyExpr.or(SearchViewFocusedKey, InSearchEditor)),
30
+ when: ( ContextKeyExpr.or(
31
+ SearchContext.SearchViewFocusedKey,
32
+ InSearchEditor
33
+ )),
34
34
  primary: 2048 | 1024 | 40 ,
35
35
  },
36
36
  });
@@ -40,7 +40,7 @@ registerAction2(class ToggleQueryDetailsAction extends Action2 {
40
40
  if (contextService.getValue(InSearchEditor.serialize())) {
41
41
  accessor.get(IEditorService).activeEditorPane.toggleQueryDetails(args[0]?.show);
42
42
  }
43
- else if (contextService.getValue(SearchViewFocusedKey.serialize())) {
43
+ else if (contextService.getValue(SearchContext.SearchViewFocusedKey.serialize())) {
44
44
  const searchView = getSearchView(accessor.get(IViewsService));
45
45
  assertIsDefined(searchView).toggleQueryDetails(undefined, args[0]?.show);
46
46
  }
@@ -49,19 +49,19 @@ registerAction2(class ToggleQueryDetailsAction extends Action2 {
49
49
  registerAction2(class CloseReplaceAction extends Action2 {
50
50
  constructor() {
51
51
  super({
52
- id: CloseReplaceWidgetActionId,
53
- title: {
54
- value: ( localizeWithPath(
55
- 'vs/workbench/contrib/search/browser/searchActionsNav',
56
- 'CloseReplaceWidget.label',
57
- "Close Replace Widget"
58
- )),
59
- original: 'Close Replace Widget'
60
- },
52
+ id: "closeReplaceInFilesWidget" ,
53
+ title: ( localize2WithPath(
54
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
55
+ 'CloseReplaceWidget.label',
56
+ "Close Replace Widget"
57
+ )),
61
58
  category,
62
59
  keybinding: {
63
60
  weight: 200 ,
64
- when: ( ContextKeyExpr.and(SearchViewVisibleKey, ReplaceInputBoxFocusedKey)),
61
+ when: ( ContextKeyExpr.and(
62
+ SearchContext.SearchViewVisibleKey,
63
+ SearchContext.ReplaceInputBoxFocusedKey
64
+ )),
65
65
  primary: 9 ,
66
66
  },
67
67
  });
@@ -78,19 +78,16 @@ registerAction2(class CloseReplaceAction extends Action2 {
78
78
  registerAction2(class ToggleCaseSensitiveCommandAction extends Action2 {
79
79
  constructor() {
80
80
  super({
81
- id: ToggleCaseSensitiveCommandId,
82
- title: {
83
- value: ( localizeWithPath(
84
- 'vs/workbench/contrib/search/browser/searchActionsNav',
85
- 'ToggleCaseSensitiveCommandId.label',
86
- "Toggle Case Sensitive"
87
- )),
88
- original: 'Toggle Case Sensitive'
89
- },
81
+ id: "toggleSearchCaseSensitive" ,
82
+ title: ( localize2WithPath(
83
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
84
+ 'ToggleCaseSensitiveCommandId.label',
85
+ "Toggle Case Sensitive"
86
+ )),
90
87
  category,
91
88
  keybinding: Object.assign({
92
89
  weight: 200 ,
93
- when: isMacintosh ? ( ContextKeyExpr.and(SearchViewFocusedKey, ( FileMatchOrFolderMatchFocusKey.toNegated()))) : SearchViewFocusedKey,
90
+ when: isMacintosh ? ( ContextKeyExpr.and(SearchContext.SearchViewFocusedKey, ( SearchContext.FileMatchOrFolderMatchFocusKey.toNegated()))) : SearchContext.SearchViewFocusedKey,
94
91
  }, ToggleCaseSensitiveKeybinding)
95
92
  });
96
93
  }
@@ -101,18 +98,15 @@ registerAction2(class ToggleCaseSensitiveCommandAction extends Action2 {
101
98
  registerAction2(class ToggleWholeWordCommandAction extends Action2 {
102
99
  constructor() {
103
100
  super({
104
- id: ToggleWholeWordCommandId,
105
- title: {
106
- value: ( localizeWithPath(
107
- 'vs/workbench/contrib/search/browser/searchActionsNav',
108
- 'ToggleWholeWordCommandId.label',
109
- 'Toggle Whole Word'
110
- )),
111
- original: 'Toggle Whole Word'
112
- },
101
+ id: "toggleSearchWholeWord" ,
102
+ title: ( localize2WithPath(
103
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
104
+ 'ToggleWholeWordCommandId.label',
105
+ "Toggle Whole Word"
106
+ )),
113
107
  keybinding: Object.assign({
114
108
  weight: 200 ,
115
- when: SearchViewFocusedKey,
109
+ when: SearchContext.SearchViewFocusedKey,
116
110
  }, ToggleWholeWordKeybinding),
117
111
  category,
118
112
  });
@@ -124,18 +118,15 @@ registerAction2(class ToggleWholeWordCommandAction extends Action2 {
124
118
  registerAction2(class ToggleRegexCommandAction extends Action2 {
125
119
  constructor() {
126
120
  super({
127
- id: ToggleRegexCommandId,
128
- title: {
129
- value: ( localizeWithPath(
130
- 'vs/workbench/contrib/search/browser/searchActionsNav',
131
- 'ToggleRegexCommandId.label',
132
- 'Toggle Regex'
133
- )),
134
- original: 'Toggle Regex'
135
- },
121
+ id: "toggleSearchRegex" ,
122
+ title: ( localize2WithPath(
123
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
124
+ 'ToggleRegexCommandId.label',
125
+ "Toggle Regex"
126
+ )),
136
127
  keybinding: Object.assign({
137
128
  weight: 200 ,
138
- when: SearchViewFocusedKey,
129
+ when: SearchContext.SearchViewFocusedKey,
139
130
  }, ToggleRegexKeybinding),
140
131
  category,
141
132
  });
@@ -147,18 +138,15 @@ registerAction2(class ToggleRegexCommandAction extends Action2 {
147
138
  registerAction2(class TogglePreserveCaseAction extends Action2 {
148
139
  constructor() {
149
140
  super({
150
- id: TogglePreserveCaseId,
151
- title: {
152
- value: ( localizeWithPath(
153
- 'vs/workbench/contrib/search/browser/searchActionsNav',
154
- 'TogglePreserveCaseId.label',
155
- 'Toggle Preserve Case'
156
- )),
157
- original: 'Toggle Preserve Case'
158
- },
141
+ id: "toggleSearchPreserveCase" ,
142
+ title: ( localize2WithPath(
143
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
144
+ 'TogglePreserveCaseId.label',
145
+ "Toggle Preserve Case"
146
+ )),
159
147
  keybinding: Object.assign({
160
148
  weight: 200 ,
161
- when: SearchViewFocusedKey,
149
+ when: SearchContext.SearchViewFocusedKey,
162
150
  }, TogglePreserveCaseKeybinding),
163
151
  category,
164
152
  });
@@ -170,19 +158,19 @@ registerAction2(class TogglePreserveCaseAction extends Action2 {
170
158
  registerAction2(class OpenMatchAction extends Action2 {
171
159
  constructor() {
172
160
  super({
173
- id: OpenMatch,
174
- title: {
175
- value: ( localizeWithPath(
176
- 'vs/workbench/contrib/search/browser/searchActionsNav',
177
- 'OpenMatch.label',
178
- "Open Match"
179
- )),
180
- original: 'Open Match'
181
- },
161
+ id: "search.action.openResult" ,
162
+ title: ( localize2WithPath(
163
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
164
+ 'OpenMatch.label',
165
+ "Open Match"
166
+ )),
182
167
  category,
183
168
  keybinding: {
184
169
  weight: 200 ,
185
- when: ( ContextKeyExpr.and(SearchViewVisibleKey, FileMatchOrMatchFocusKey)),
170
+ when: ( ContextKeyExpr.and(
171
+ SearchContext.SearchViewVisibleKey,
172
+ SearchContext.FileMatchOrMatchFocusKey
173
+ )),
186
174
  primary: 3 ,
187
175
  mac: {
188
176
  primary: 3 ,
@@ -209,19 +197,19 @@ registerAction2(class OpenMatchAction extends Action2 {
209
197
  registerAction2(class OpenMatchToSideAction extends Action2 {
210
198
  constructor() {
211
199
  super({
212
- id: OpenMatchToSide,
213
- title: {
214
- value: ( localizeWithPath(
215
- 'vs/workbench/contrib/search/browser/searchActionsNav',
216
- 'OpenMatchToSide.label',
217
- "Open Match To Side"
218
- )),
219
- original: 'Open Match To Side'
220
- },
200
+ id: "search.action.openResultToSide" ,
201
+ title: ( localize2WithPath(
202
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
203
+ 'OpenMatchToSide.label',
204
+ "Open Match To Side"
205
+ )),
221
206
  category,
222
207
  keybinding: {
223
208
  weight: 200 ,
224
- when: ( ContextKeyExpr.and(SearchViewVisibleKey, FileMatchOrMatchFocusKey)),
209
+ when: ( ContextKeyExpr.and(
210
+ SearchContext.SearchViewVisibleKey,
211
+ SearchContext.FileMatchOrMatchFocusKey
212
+ )),
225
213
  primary: 2048 | 3 ,
226
214
  mac: {
227
215
  primary: 256 | 3
@@ -240,18 +228,18 @@ registerAction2(class OpenMatchToSideAction extends Action2 {
240
228
  registerAction2(class AddCursorsAtSearchResultsAction extends Action2 {
241
229
  constructor() {
242
230
  super({
243
- id: AddCursorsAtSearchResults,
244
- title: {
245
- value: ( localizeWithPath(
246
- 'vs/workbench/contrib/search/browser/searchActionsNav',
247
- 'AddCursorsAtSearchResults.label',
248
- 'Add Cursors at Search Results'
249
- )),
250
- original: 'Add Cursors at Search Results'
251
- },
231
+ id: "addCursorsAtSearchResults" ,
232
+ title: ( localize2WithPath(
233
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
234
+ 'AddCursorsAtSearchResults.label',
235
+ "Add Cursors at Search Results"
236
+ )),
252
237
  keybinding: {
253
238
  weight: 200 ,
254
- when: ( ContextKeyExpr.and(SearchViewVisibleKey, FileMatchOrMatchFocusKey)),
239
+ when: ( ContextKeyExpr.and(
240
+ SearchContext.SearchViewVisibleKey,
241
+ SearchContext.FileMatchOrMatchFocusKey
242
+ )),
255
243
  primary: 2048 | 1024 | 42 ,
256
244
  },
257
245
  category,
@@ -268,19 +256,22 @@ registerAction2(class AddCursorsAtSearchResultsAction extends Action2 {
268
256
  registerAction2(class FocusNextInputAction extends Action2 {
269
257
  constructor() {
270
258
  super({
271
- id: FocusNextInputActionId,
272
- title: {
273
- value: ( localizeWithPath(
274
- 'vs/workbench/contrib/search/browser/searchActionsNav',
275
- 'FocusNextInputAction.label',
276
- "Focus Next Input"
277
- )),
278
- original: 'Focus Next Input'
279
- },
259
+ id: "search.focus.nextInputBox" ,
260
+ title: ( localize2WithPath(
261
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
262
+ 'FocusNextInputAction.label',
263
+ "Focus Next Input"
264
+ )),
280
265
  category,
281
266
  keybinding: {
282
267
  weight: 200 ,
283
- when: ( ContextKeyExpr.or(( ContextKeyExpr.and(InSearchEditor, InputBoxFocusedKey)), ( ContextKeyExpr.and(SearchViewVisibleKey, InputBoxFocusedKey)))),
268
+ when: ( ContextKeyExpr.or(( ContextKeyExpr.and(
269
+ InSearchEditor,
270
+ SearchContext.InputBoxFocusedKey
271
+ )), ( ContextKeyExpr.and(
272
+ SearchContext.SearchViewVisibleKey,
273
+ SearchContext.InputBoxFocusedKey
274
+ )))),
284
275
  primary: 2048 | 18 ,
285
276
  },
286
277
  });
@@ -298,22 +289,22 @@ registerAction2(class FocusNextInputAction extends Action2 {
298
289
  registerAction2(class FocusPreviousInputAction extends Action2 {
299
290
  constructor() {
300
291
  super({
301
- id: FocusPreviousInputActionId,
302
- title: {
303
- value: ( localizeWithPath(
304
- 'vs/workbench/contrib/search/browser/searchActionsNav',
305
- 'FocusPreviousInputAction.label',
306
- "Focus Previous Input"
307
- )),
308
- original: 'Focus Previous Input'
309
- },
292
+ id: "search.focus.previousInputBox" ,
293
+ title: ( localize2WithPath(
294
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
295
+ 'FocusPreviousInputAction.label',
296
+ "Focus Previous Input"
297
+ )),
310
298
  category,
311
299
  keybinding: {
312
300
  weight: 200 ,
313
- when: ( ContextKeyExpr.or(( ContextKeyExpr.and(InSearchEditor, InputBoxFocusedKey)), ( ContextKeyExpr.and(
314
- SearchViewVisibleKey,
315
- InputBoxFocusedKey,
316
- ( SearchInputBoxFocusedKey.toNegated())
301
+ when: ( ContextKeyExpr.or(( ContextKeyExpr.and(
302
+ InSearchEditor,
303
+ SearchContext.InputBoxFocusedKey
304
+ )), ( ContextKeyExpr.and(
305
+ SearchContext.SearchViewVisibleKey,
306
+ SearchContext.InputBoxFocusedKey,
307
+ ( SearchContext.SearchInputBoxFocusedKey.toNegated())
317
308
  )))),
318
309
  primary: 2048 | 16 ,
319
310
  },
@@ -332,19 +323,19 @@ registerAction2(class FocusPreviousInputAction extends Action2 {
332
323
  registerAction2(class FocusSearchFromResultsAction extends Action2 {
333
324
  constructor() {
334
325
  super({
335
- id: FocusSearchFromResults,
336
- title: {
337
- value: ( localizeWithPath(
338
- 'vs/workbench/contrib/search/browser/searchActionsNav',
339
- 'FocusSearchFromResults.label',
340
- "Focus Search From Results"
341
- )),
342
- original: 'Focus Search From Results'
343
- },
326
+ id: "search.action.focusSearchFromResults" ,
327
+ title: ( localize2WithPath(
328
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
329
+ 'FocusSearchFromResults.label',
330
+ "Focus Search From Results"
331
+ )),
344
332
  category,
345
333
  keybinding: {
346
334
  weight: 200 ,
347
- when: ( ContextKeyExpr.and(SearchViewVisibleKey, ( ContextKeyExpr.or(FirstMatchFocusKey, CONTEXT_ACCESSIBILITY_MODE_ENABLED)))),
335
+ when: ( ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, ( ContextKeyExpr.or(
336
+ SearchContext.FirstMatchFocusKey,
337
+ CONTEXT_ACCESSIBILITY_MODE_ENABLED
338
+ )))),
348
339
  primary: 2048 | 16 ,
349
340
  },
350
341
  });
@@ -358,15 +349,12 @@ registerAction2(class ToggleSearchOnTypeAction extends Action2 {
358
349
  static { this.searchOnTypeKey = 'search.searchOnType'; }
359
350
  constructor() {
360
351
  super({
361
- id: ToggleSearchOnTypeActionId,
362
- title: {
363
- value: ( localizeWithPath(
364
- 'vs/workbench/contrib/search/browser/searchActionsNav',
365
- 'toggleTabs',
366
- 'Toggle Search on Type'
367
- )),
368
- original: 'Toggle Search on Type'
369
- },
352
+ id: "workbench.action.toggleSearchOnType" ,
353
+ title: ( localize2WithPath(
354
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
355
+ 'toggleTabs',
356
+ "Toggle Search on Type"
357
+ )),
370
358
  category,
371
359
  });
372
360
  }
@@ -379,15 +367,12 @@ registerAction2(class ToggleSearchOnTypeAction extends Action2 {
379
367
  registerAction2(class FocusSearchListCommandAction extends Action2 {
380
368
  constructor() {
381
369
  super({
382
- id: FocusSearchListCommandID,
383
- title: {
384
- value: ( localizeWithPath(
385
- 'vs/workbench/contrib/search/browser/searchActionsNav',
386
- 'focusSearchListCommandLabel',
387
- "Focus List"
388
- )),
389
- original: 'Focus List'
390
- },
370
+ id: "search.action.focusSearchList" ,
371
+ title: ( localize2WithPath(
372
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
373
+ 'focusSearchListCommandLabel',
374
+ "Focus List"
375
+ )),
391
376
  category,
392
377
  f1: true
393
378
  });
@@ -399,22 +384,22 @@ registerAction2(class FocusSearchListCommandAction extends Action2 {
399
384
  registerAction2(class FocusNextSearchResultAction extends Action2 {
400
385
  constructor() {
401
386
  super({
402
- id: FocusNextSearchResultActionId,
403
- title: {
404
- value: ( localizeWithPath(
405
- 'vs/workbench/contrib/search/browser/searchActionsNav',
406
- 'FocusNextSearchResult.label',
407
- 'Focus Next Search Result'
408
- )),
409
- original: 'Focus Next Search Result'
410
- },
387
+ id: "search.action.focusNextSearchResult" ,
388
+ title: ( localize2WithPath(
389
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
390
+ 'FocusNextSearchResult.label',
391
+ "Focus Next Search Result"
392
+ )),
411
393
  keybinding: [{
412
394
  primary: 62 ,
413
395
  weight: 200 ,
414
396
  }],
415
397
  category,
416
398
  f1: true,
417
- precondition: ( ContextKeyExpr.or(HasSearchResults, InSearchEditor)),
399
+ precondition: ( ContextKeyExpr.or(
400
+ SearchContext.HasSearchResults,
401
+ InSearchEditor
402
+ )),
418
403
  });
419
404
  }
420
405
  async run(accessor) {
@@ -424,22 +409,22 @@ registerAction2(class FocusNextSearchResultAction extends Action2 {
424
409
  registerAction2(class FocusPreviousSearchResultAction extends Action2 {
425
410
  constructor() {
426
411
  super({
427
- id: FocusPreviousSearchResultActionId,
428
- title: {
429
- value: ( localizeWithPath(
430
- 'vs/workbench/contrib/search/browser/searchActionsNav',
431
- 'FocusPreviousSearchResult.label',
432
- 'Focus Previous Search Result'
433
- )),
434
- original: 'Focus Previous Search Result'
435
- },
412
+ id: "search.action.focusPreviousSearchResult" ,
413
+ title: ( localize2WithPath(
414
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
415
+ 'FocusPreviousSearchResult.label',
416
+ "Focus Previous Search Result"
417
+ )),
436
418
  keybinding: [{
437
419
  primary: 1024 | 62 ,
438
420
  weight: 200 ,
439
421
  }],
440
422
  category,
441
423
  f1: true,
442
- precondition: ( ContextKeyExpr.or(HasSearchResults, InSearchEditor)),
424
+ precondition: ( ContextKeyExpr.or(
425
+ SearchContext.HasSearchResults,
426
+ InSearchEditor
427
+ )),
443
428
  });
444
429
  }
445
430
  async run(accessor) {
@@ -449,15 +434,12 @@ registerAction2(class FocusPreviousSearchResultAction extends Action2 {
449
434
  registerAction2(class ReplaceInFilesAction extends Action2 {
450
435
  constructor() {
451
436
  super({
452
- id: ReplaceInFilesActionId,
453
- title: {
454
- value: ( localizeWithPath(
455
- 'vs/workbench/contrib/search/browser/searchActionsNav',
456
- 'replaceInFiles',
457
- 'Replace in Files'
458
- )),
459
- original: 'Replace in Files'
460
- },
437
+ id: "workbench.action.replaceInFiles" ,
438
+ title: ( localize2WithPath(
439
+ 'vs/workbench/contrib/search/browser/searchActionsNav',
440
+ 'replaceInFiles',
441
+ "Replace in Files"
442
+ )),
461
443
  keybinding: [{
462
444
  primary: 2048 | 1024 | 38 ,
463
445
  weight: 200 ,