@codingame/monaco-vscode-search-service-override 3.2.3 → 4.1.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.
Files changed (35) hide show
  1. package/package.json +2 -2
  2. package/search.js +4 -4
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  6. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +0 -776
  7. package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +0 -6
  8. package/vscode/src/vs/workbench/contrib/search/browser/media/searchview.css.js +0 -6
  9. package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +0 -231
  10. package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +0 -342
  11. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +0 -8
  12. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +0 -232
  13. package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +0 -621
  14. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +0 -209
  15. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +0 -511
  16. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +0 -374
  17. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +0 -43
  18. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +0 -44
  19. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +0 -323
  20. package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +0 -47
  21. package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +0 -96
  22. package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +0 -66
  23. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +0 -434
  24. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +0 -2096
  25. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +0 -667
  26. package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +0 -234
  27. package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +0 -87
  28. package/vscode/src/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +0 -6
  29. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +0 -586
  30. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +0 -736
  31. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +0 -189
  32. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +0 -320
  33. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +0 -138
  34. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +0 -293
  35. package/vscode/src/vs/workbench/services/search/common/searchService.js +0 -372
@@ -1,511 +0,0 @@
1
- import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
2
- import { localize2WithPath } from 'vscode/vscode/vs/nls';
3
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
4
- import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
5
- import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
6
- import { InSearchEditor } from 'vscode/vscode/vs/workbench/contrib/searchEditor/browser/constants';
7
- import { FolderMatch } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
8
- import { SearchEditorInput } from '../../searchEditor/browser/searchEditorInput.js';
9
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
10
- import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
11
- import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
12
- import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
13
- import { ToggleCaseSensitiveKeybinding, ToggleWholeWordKeybinding, ToggleRegexKeybinding, TogglePreserveCaseKeybinding } from 'vscode/vscode/vs/editor/contrib/find/browser/findModel';
14
- import { category, getSearchView, openSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
15
- import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
16
- import { getActiveElement } from 'vscode/vscode/vs/base/browser/dom';
17
-
18
- registerAction2(class ToggleQueryDetailsAction extends Action2 {
19
- constructor() {
20
- super({
21
- id: "workbench.action.search.toggleQueryDetails" ,
22
- title: ( localize2WithPath(
23
- 'vs/workbench/contrib/search/browser/searchActionsNav',
24
- 'ToggleQueryDetailsAction.label',
25
- "Toggle Query Details"
26
- )),
27
- category,
28
- keybinding: {
29
- weight: 200 ,
30
- when: ( ContextKeyExpr.or(
31
- SearchContext.SearchViewFocusedKey,
32
- InSearchEditor
33
- )),
34
- primary: 2048 | 1024 | 40 ,
35
- },
36
- });
37
- }
38
- run(accessor, ...args) {
39
- const contextService = accessor.get(IContextKeyService).getContext(getActiveElement());
40
- if (contextService.getValue(InSearchEditor.serialize())) {
41
- accessor.get(IEditorService).activeEditorPane.toggleQueryDetails(args[0]?.show);
42
- }
43
- else if (contextService.getValue(SearchContext.SearchViewFocusedKey.serialize())) {
44
- const searchView = getSearchView(accessor.get(IViewsService));
45
- assertIsDefined(searchView).toggleQueryDetails(undefined, args[0]?.show);
46
- }
47
- }
48
- });
49
- registerAction2(class CloseReplaceAction extends Action2 {
50
- constructor() {
51
- super({
52
- id: "closeReplaceInFilesWidget" ,
53
- title: ( localize2WithPath(
54
- 'vs/workbench/contrib/search/browser/searchActionsNav',
55
- 'CloseReplaceWidget.label',
56
- "Close Replace Widget"
57
- )),
58
- category,
59
- keybinding: {
60
- weight: 200 ,
61
- when: ( ContextKeyExpr.and(
62
- SearchContext.SearchViewVisibleKey,
63
- SearchContext.ReplaceInputBoxFocusedKey
64
- )),
65
- primary: 9 ,
66
- },
67
- });
68
- }
69
- run(accessor) {
70
- const searchView = getSearchView(accessor.get(IViewsService));
71
- if (searchView) {
72
- searchView.searchAndReplaceWidget.toggleReplace(false);
73
- searchView.searchAndReplaceWidget.focus();
74
- }
75
- return Promise.resolve(null);
76
- }
77
- });
78
- registerAction2(class ToggleCaseSensitiveCommandAction extends Action2 {
79
- constructor() {
80
- super({
81
- id: "toggleSearchCaseSensitive" ,
82
- title: ( localize2WithPath(
83
- 'vs/workbench/contrib/search/browser/searchActionsNav',
84
- 'ToggleCaseSensitiveCommandId.label',
85
- "Toggle Case Sensitive"
86
- )),
87
- category,
88
- keybinding: Object.assign({
89
- weight: 200 ,
90
- when: isMacintosh ? ( ContextKeyExpr.and(SearchContext.SearchViewFocusedKey, ( SearchContext.FileMatchOrFolderMatchFocusKey.toNegated()))) : SearchContext.SearchViewFocusedKey,
91
- }, ToggleCaseSensitiveKeybinding)
92
- });
93
- }
94
- async run(accessor) {
95
- toggleCaseSensitiveCommand(accessor);
96
- }
97
- });
98
- registerAction2(class ToggleWholeWordCommandAction extends Action2 {
99
- constructor() {
100
- super({
101
- id: "toggleSearchWholeWord" ,
102
- title: ( localize2WithPath(
103
- 'vs/workbench/contrib/search/browser/searchActionsNav',
104
- 'ToggleWholeWordCommandId.label',
105
- "Toggle Whole Word"
106
- )),
107
- keybinding: Object.assign({
108
- weight: 200 ,
109
- when: SearchContext.SearchViewFocusedKey,
110
- }, ToggleWholeWordKeybinding),
111
- category,
112
- });
113
- }
114
- async run(accessor) {
115
- return toggleWholeWordCommand(accessor);
116
- }
117
- });
118
- registerAction2(class ToggleRegexCommandAction extends Action2 {
119
- constructor() {
120
- super({
121
- id: "toggleSearchRegex" ,
122
- title: ( localize2WithPath(
123
- 'vs/workbench/contrib/search/browser/searchActionsNav',
124
- 'ToggleRegexCommandId.label',
125
- "Toggle Regex"
126
- )),
127
- keybinding: Object.assign({
128
- weight: 200 ,
129
- when: SearchContext.SearchViewFocusedKey,
130
- }, ToggleRegexKeybinding),
131
- category,
132
- });
133
- }
134
- async run(accessor) {
135
- return toggleRegexCommand(accessor);
136
- }
137
- });
138
- registerAction2(class TogglePreserveCaseAction extends Action2 {
139
- constructor() {
140
- super({
141
- id: "toggleSearchPreserveCase" ,
142
- title: ( localize2WithPath(
143
- 'vs/workbench/contrib/search/browser/searchActionsNav',
144
- 'TogglePreserveCaseId.label',
145
- "Toggle Preserve Case"
146
- )),
147
- keybinding: Object.assign({
148
- weight: 200 ,
149
- when: SearchContext.SearchViewFocusedKey,
150
- }, TogglePreserveCaseKeybinding),
151
- category,
152
- });
153
- }
154
- async run(accessor) {
155
- return togglePreserveCaseCommand(accessor);
156
- }
157
- });
158
- registerAction2(class OpenMatchAction extends Action2 {
159
- constructor() {
160
- super({
161
- id: "search.action.openResult" ,
162
- title: ( localize2WithPath(
163
- 'vs/workbench/contrib/search/browser/searchActionsNav',
164
- 'OpenMatch.label',
165
- "Open Match"
166
- )),
167
- category,
168
- keybinding: {
169
- weight: 200 ,
170
- when: ( ContextKeyExpr.and(
171
- SearchContext.SearchViewVisibleKey,
172
- SearchContext.FileMatchOrMatchFocusKey
173
- )),
174
- primary: 3 ,
175
- mac: {
176
- primary: 3 ,
177
- secondary: [2048 | 18 ]
178
- },
179
- },
180
- });
181
- }
182
- run(accessor) {
183
- const searchView = getSearchView(accessor.get(IViewsService));
184
- if (searchView) {
185
- const tree = searchView.getControl();
186
- const viewer = searchView.getControl();
187
- const focus = tree.getFocus()[0];
188
- if (focus instanceof FolderMatch) {
189
- viewer.toggleCollapsed(focus);
190
- }
191
- else {
192
- searchView.open(tree.getFocus()[0], false, false, true);
193
- }
194
- }
195
- }
196
- });
197
- registerAction2(class OpenMatchToSideAction extends Action2 {
198
- constructor() {
199
- super({
200
- id: "search.action.openResultToSide" ,
201
- title: ( localize2WithPath(
202
- 'vs/workbench/contrib/search/browser/searchActionsNav',
203
- 'OpenMatchToSide.label',
204
- "Open Match To Side"
205
- )),
206
- category,
207
- keybinding: {
208
- weight: 200 ,
209
- when: ( ContextKeyExpr.and(
210
- SearchContext.SearchViewVisibleKey,
211
- SearchContext.FileMatchOrMatchFocusKey
212
- )),
213
- primary: 2048 | 3 ,
214
- mac: {
215
- primary: 256 | 3
216
- },
217
- },
218
- });
219
- }
220
- run(accessor) {
221
- const searchView = getSearchView(accessor.get(IViewsService));
222
- if (searchView) {
223
- const tree = searchView.getControl();
224
- searchView.open(tree.getFocus()[0], false, true, true);
225
- }
226
- }
227
- });
228
- registerAction2(class AddCursorsAtSearchResultsAction extends Action2 {
229
- constructor() {
230
- super({
231
- id: "addCursorsAtSearchResults" ,
232
- title: ( localize2WithPath(
233
- 'vs/workbench/contrib/search/browser/searchActionsNav',
234
- 'AddCursorsAtSearchResults.label',
235
- "Add Cursors at Search Results"
236
- )),
237
- keybinding: {
238
- weight: 200 ,
239
- when: ( ContextKeyExpr.and(
240
- SearchContext.SearchViewVisibleKey,
241
- SearchContext.FileMatchOrMatchFocusKey
242
- )),
243
- primary: 2048 | 1024 | 42 ,
244
- },
245
- category,
246
- });
247
- }
248
- async run(accessor) {
249
- const searchView = getSearchView(accessor.get(IViewsService));
250
- if (searchView) {
251
- const tree = searchView.getControl();
252
- searchView.openEditorWithMultiCursor(tree.getFocus()[0]);
253
- }
254
- }
255
- });
256
- registerAction2(class FocusNextInputAction extends Action2 {
257
- constructor() {
258
- super({
259
- id: "search.focus.nextInputBox" ,
260
- title: ( localize2WithPath(
261
- 'vs/workbench/contrib/search/browser/searchActionsNav',
262
- 'FocusNextInputAction.label',
263
- "Focus Next Input"
264
- )),
265
- category,
266
- keybinding: {
267
- weight: 200 ,
268
- when: ( ContextKeyExpr.or(( ContextKeyExpr.and(
269
- InSearchEditor,
270
- SearchContext.InputBoxFocusedKey
271
- )), ( ContextKeyExpr.and(
272
- SearchContext.SearchViewVisibleKey,
273
- SearchContext.InputBoxFocusedKey
274
- )))),
275
- primary: 2048 | 18 ,
276
- },
277
- });
278
- }
279
- async run(accessor) {
280
- const editorService = accessor.get(IEditorService);
281
- const input = editorService.activeEditor;
282
- if (input instanceof SearchEditorInput) {
283
- editorService.activeEditorPane.focusNextInput();
284
- }
285
- const searchView = getSearchView(accessor.get(IViewsService));
286
- searchView?.focusNextInputBox();
287
- }
288
- });
289
- registerAction2(class FocusPreviousInputAction extends Action2 {
290
- constructor() {
291
- super({
292
- id: "search.focus.previousInputBox" ,
293
- title: ( localize2WithPath(
294
- 'vs/workbench/contrib/search/browser/searchActionsNav',
295
- 'FocusPreviousInputAction.label',
296
- "Focus Previous Input"
297
- )),
298
- category,
299
- keybinding: {
300
- weight: 200 ,
301
- when: ( ContextKeyExpr.or(( ContextKeyExpr.and(
302
- InSearchEditor,
303
- SearchContext.InputBoxFocusedKey
304
- )), ( ContextKeyExpr.and(
305
- SearchContext.SearchViewVisibleKey,
306
- SearchContext.InputBoxFocusedKey,
307
- ( SearchContext.SearchInputBoxFocusedKey.toNegated())
308
- )))),
309
- primary: 2048 | 16 ,
310
- },
311
- });
312
- }
313
- async run(accessor) {
314
- const editorService = accessor.get(IEditorService);
315
- const input = editorService.activeEditor;
316
- if (input instanceof SearchEditorInput) {
317
- editorService.activeEditorPane.focusPrevInput();
318
- }
319
- const searchView = getSearchView(accessor.get(IViewsService));
320
- searchView?.focusPreviousInputBox();
321
- }
322
- });
323
- registerAction2(class FocusSearchFromResultsAction extends Action2 {
324
- constructor() {
325
- super({
326
- id: "search.action.focusSearchFromResults" ,
327
- title: ( localize2WithPath(
328
- 'vs/workbench/contrib/search/browser/searchActionsNav',
329
- 'FocusSearchFromResults.label',
330
- "Focus Search From Results"
331
- )),
332
- category,
333
- keybinding: {
334
- weight: 200 ,
335
- when: ( ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, ( ContextKeyExpr.or(
336
- SearchContext.FirstMatchFocusKey,
337
- CONTEXT_ACCESSIBILITY_MODE_ENABLED
338
- )))),
339
- primary: 2048 | 16 ,
340
- },
341
- });
342
- }
343
- run(accessor) {
344
- const searchView = getSearchView(accessor.get(IViewsService));
345
- searchView?.focusPreviousInputBox();
346
- }
347
- });
348
- registerAction2(class ToggleSearchOnTypeAction extends Action2 {
349
- static { this.searchOnTypeKey = 'search.searchOnType'; }
350
- constructor() {
351
- super({
352
- id: "workbench.action.toggleSearchOnType" ,
353
- title: ( localize2WithPath(
354
- 'vs/workbench/contrib/search/browser/searchActionsNav',
355
- 'toggleTabs',
356
- "Toggle Search on Type"
357
- )),
358
- category,
359
- });
360
- }
361
- async run(accessor) {
362
- const configurationService = accessor.get(IConfigurationService);
363
- const searchOnType = configurationService.getValue(ToggleSearchOnTypeAction.searchOnTypeKey);
364
- return configurationService.updateValue(ToggleSearchOnTypeAction.searchOnTypeKey, !searchOnType);
365
- }
366
- });
367
- registerAction2(class FocusSearchListCommandAction extends Action2 {
368
- constructor() {
369
- super({
370
- id: "search.action.focusSearchList" ,
371
- title: ( localize2WithPath(
372
- 'vs/workbench/contrib/search/browser/searchActionsNav',
373
- 'focusSearchListCommandLabel',
374
- "Focus List"
375
- )),
376
- category,
377
- f1: true
378
- });
379
- }
380
- async run(accessor) {
381
- focusSearchListCommand(accessor);
382
- }
383
- });
384
- registerAction2(class FocusNextSearchResultAction extends Action2 {
385
- constructor() {
386
- super({
387
- id: "search.action.focusNextSearchResult" ,
388
- title: ( localize2WithPath(
389
- 'vs/workbench/contrib/search/browser/searchActionsNav',
390
- 'FocusNextSearchResult.label',
391
- "Focus Next Search Result"
392
- )),
393
- keybinding: [{
394
- primary: 62 ,
395
- weight: 200 ,
396
- }],
397
- category,
398
- f1: true,
399
- precondition: ( ContextKeyExpr.or(
400
- SearchContext.HasSearchResults,
401
- InSearchEditor
402
- )),
403
- });
404
- }
405
- async run(accessor) {
406
- return await focusNextSearchResult(accessor);
407
- }
408
- });
409
- registerAction2(class FocusPreviousSearchResultAction extends Action2 {
410
- constructor() {
411
- super({
412
- id: "search.action.focusPreviousSearchResult" ,
413
- title: ( localize2WithPath(
414
- 'vs/workbench/contrib/search/browser/searchActionsNav',
415
- 'FocusPreviousSearchResult.label',
416
- "Focus Previous Search Result"
417
- )),
418
- keybinding: [{
419
- primary: 1024 | 62 ,
420
- weight: 200 ,
421
- }],
422
- category,
423
- f1: true,
424
- precondition: ( ContextKeyExpr.or(
425
- SearchContext.HasSearchResults,
426
- InSearchEditor
427
- )),
428
- });
429
- }
430
- async run(accessor) {
431
- return await focusPreviousSearchResult(accessor);
432
- }
433
- });
434
- registerAction2(class ReplaceInFilesAction extends Action2 {
435
- constructor() {
436
- super({
437
- id: "workbench.action.replaceInFiles" ,
438
- title: ( localize2WithPath(
439
- 'vs/workbench/contrib/search/browser/searchActionsNav',
440
- 'replaceInFiles',
441
- "Replace in Files"
442
- )),
443
- keybinding: [{
444
- primary: 2048 | 1024 | 38 ,
445
- weight: 200 ,
446
- }],
447
- category,
448
- f1: true,
449
- menu: [{
450
- id: MenuId.MenubarEditMenu,
451
- group: '4_find_global',
452
- order: 2
453
- }],
454
- });
455
- }
456
- async run(accessor) {
457
- return await findOrReplaceInFiles(accessor, true);
458
- }
459
- });
460
- function toggleCaseSensitiveCommand(accessor) {
461
- const searchView = getSearchView(accessor.get(IViewsService));
462
- searchView?.toggleCaseSensitive();
463
- }
464
- function toggleWholeWordCommand(accessor) {
465
- const searchView = getSearchView(accessor.get(IViewsService));
466
- searchView?.toggleWholeWords();
467
- }
468
- function toggleRegexCommand(accessor) {
469
- const searchView = getSearchView(accessor.get(IViewsService));
470
- searchView?.toggleRegex();
471
- }
472
- function togglePreserveCaseCommand(accessor) {
473
- const searchView = getSearchView(accessor.get(IViewsService));
474
- searchView?.togglePreserveCase();
475
- }
476
- const focusSearchListCommand = accessor => {
477
- const viewsService = accessor.get(IViewsService);
478
- openSearchView(viewsService).then(searchView => {
479
- searchView?.moveFocusToResults();
480
- });
481
- };
482
- async function focusNextSearchResult(accessor) {
483
- const editorService = accessor.get(IEditorService);
484
- const input = editorService.activeEditor;
485
- if (input instanceof SearchEditorInput) {
486
- return editorService.activeEditorPane.focusNextResult();
487
- }
488
- return openSearchView(accessor.get(IViewsService)).then(searchView => {
489
- searchView?.selectNextMatch();
490
- });
491
- }
492
- async function focusPreviousSearchResult(accessor) {
493
- const editorService = accessor.get(IEditorService);
494
- const input = editorService.activeEditor;
495
- if (input instanceof SearchEditorInput) {
496
- return editorService.activeEditorPane.focusPreviousResult();
497
- }
498
- return openSearchView(accessor.get(IViewsService)).then(searchView => {
499
- searchView?.selectPreviousMatch();
500
- });
501
- }
502
- async function findOrReplaceInFiles(accessor, expandSearchReplaceWidget) {
503
- return openSearchView(accessor.get(IViewsService), false).then(openedView => {
504
- if (openedView) {
505
- const searchAndReplaceWidget = openedView.searchAndReplaceWidget;
506
- searchAndReplaceWidget.toggleReplace(expandSearchReplaceWidget);
507
- const updatedText = openedView.updateTextFromFindWidgetOrSelection({ allowUnselectedWord: !expandSearchReplaceWidget });
508
- openedView.searchAndReplaceWidget.focus(undefined, updatedText, updatedText);
509
- }
510
- });
511
- }