@codingame/monaco-vscode-search-service-override 5.3.0 → 6.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.
Files changed (27) hide show
  1. package/package.json +2 -2
  2. package/search.js +37 -3
  3. package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +3 -2
  4. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +3 -2
  5. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +2 -1
  6. package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +20 -17
  7. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +11 -9
  8. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +49 -47
  9. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +18 -16
  10. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +6 -3
  11. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +2 -1
  12. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +13 -11
  13. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +4 -4
  14. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +33 -28
  15. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +36 -32
  16. package/vscode/src/vs/workbench/contrib/search/common/searchHistoryService.js +5 -4
  17. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +26 -24
  18. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +7 -4
  19. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +2 -1
  20. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +11 -8
  21. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +3 -3
  22. package/vscode/src/vs/workbench/services/search/browser/searchService.js +4 -27
  23. package/vscode/src/vs/workbench/services/search/common/searchService.js +19 -19
  24. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +0 -764
  25. package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +0 -6
  26. package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +0 -224
  27. package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +0 -87
@@ -7,6 +7,7 @@ import { Widget } from 'vscode/vscode/vs/base/browser/ui/widget';
7
7
  import { Action } from 'vscode/vscode/vs/base/common/actions';
8
8
  import { Delayer } from 'vscode/vscode/vs/base/common/async';
9
9
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
10
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
10
11
  import { CONTEXT_FIND_WIDGET_NOT_VISIBLE } from 'vscode/vscode/vs/editor/contrib/find/browser/findModel';
11
12
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
12
13
  import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService.service';
@@ -15,11 +16,11 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
15
16
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
16
17
  import { IContextViewService, IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
17
18
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
18
- import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
19
+ import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
19
20
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
20
21
  import { ContextScopedReplaceInput } from 'vscode/vscode/vs/platform/history/browser/contextScopedHistoryWidget';
21
22
  import { appendKeyBindingLabel, isSearchViewFocused, getSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
22
- import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
23
+ import { SearchContext, SearchCommandIds } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
23
24
  import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
24
25
  import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
25
26
  import { Toggle } from 'vscode/vscode/vs/base/browser/ui/toggle/toggle';
@@ -32,6 +33,7 @@ import { NotebookFindFilters } from 'vscode/vscode/vs/workbench/contrib/notebook
32
33
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
33
34
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
34
35
  import { NotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
36
+ import { GroupModelChangeKind } from 'vscode/vscode/vs/workbench/common/editor';
35
37
  import { SearchFindInput } from './searchFindInput.js';
36
38
  import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
37
39
  import { MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
@@ -55,7 +57,7 @@ class ReplaceAllAction extends Action {
55
57
  return Promise.resolve(null);
56
58
  }
57
59
  }
58
- const ctrlKeyMod = ((isMacintosh ? 256 : 2048) );
60
+ const ctrlKeyMod = (isMacintosh ? KeyMod.WinCtrl : KeyMod.CtrlCmd);
59
61
  function stopPropagationForMultiLineUpwards(event, value, textarea) {
60
62
  const isMultiline = !!value.match(/\n/);
61
63
  if (textarea && (isMultiline || textarea.clientHeight > SingleLineInputHeight) && textarea.selectionStart > 0) {
@@ -125,7 +127,9 @@ let SearchWidget = class SearchWidget extends Widget {
125
127
  notebookOptions.isInNotebookMarkdownInput,
126
128
  notebookOptions.isInNotebookMarkdownPreview,
127
129
  notebookOptions.isInNotebookCellInput,
128
- notebookOptions.isInNotebookCellOutput
130
+ notebookOptions.isInNotebookCellOutput,
131
+ false,
132
+ []
129
133
  ))));
130
134
  this._register(this._notebookFilters.onDidChange(() => {
131
135
  if (this.searchInput) {
@@ -135,19 +139,19 @@ let SearchWidget = class SearchWidget extends Widget {
135
139
  this._register(this.editorService.onDidEditorsChange((e) => {
136
140
  if (this.searchInput &&
137
141
  e.event.editor instanceof NotebookEditorInput &&
138
- ((e.event.kind === 4 || e.event.kind === 5) )) {
142
+ (e.event.kind === GroupModelChangeKind.EDITOR_OPEN || e.event.kind === GroupModelChangeKind.EDITOR_CLOSE)) {
139
143
  this.searchInput.filterVisible = this._hasNotebookOpen();
140
144
  }
141
145
  }));
142
146
  this._replaceHistoryDelayer = ( (new Delayer(500)));
143
147
  this._toggleReplaceButtonListener = this._register(( (new MutableDisposable())));
144
148
  this.render(container, options);
145
- this.configurationService.onDidChangeConfiguration(e => {
149
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
146
150
  if (e.affectsConfiguration('editor.accessibilitySupport')) {
147
151
  this.updateAccessibilitySupport();
148
152
  }
149
- });
150
- this.accessibilityService.onDidChangeScreenReaderOptimized(() => this.updateAccessibilitySupport());
153
+ }));
154
+ this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this.updateAccessibilitySupport()));
151
155
  this.updateAccessibilitySupport();
152
156
  }
153
157
  _hasNotebookOpen() {
@@ -280,9 +284,9 @@ let SearchWidget = class SearchWidget extends Widget {
280
284
  label: ( localizeWithPath(_moduleId, 3, 'Search: Type Search Term and press Enter to search')),
281
285
  validation: (value) => this.validateSearchInput(value),
282
286
  placeholder: ( localizeWithPath(_moduleId, 4, "Search")),
283
- appendCaseSensitiveLabel: appendKeyBindingLabel('', this.keybindingService.lookupKeybinding("toggleSearchCaseSensitive" )),
284
- appendWholeWordsLabel: appendKeyBindingLabel('', this.keybindingService.lookupKeybinding("toggleSearchWholeWord" )),
285
- appendRegexLabel: appendKeyBindingLabel('', this.keybindingService.lookupKeybinding("toggleSearchRegex" )),
287
+ appendCaseSensitiveLabel: appendKeyBindingLabel('', this.keybindingService.lookupKeybinding(SearchCommandIds.ToggleCaseSensitiveCommandId)),
288
+ appendWholeWordsLabel: appendKeyBindingLabel('', this.keybindingService.lookupKeybinding(SearchCommandIds.ToggleWholeWordCommandId)),
289
+ appendRegexLabel: appendKeyBindingLabel('', this.keybindingService.lookupKeybinding(SearchCommandIds.ToggleRegexCommandId)),
286
290
  history: options.searchHistory,
287
291
  showHistoryHint: () => showHistoryKeybindingHint(this.keybindingService),
288
292
  flexibleHeight: true,
@@ -303,7 +307,7 @@ let SearchWidget = class SearchWidget extends Widget {
303
307
  options.initialAIButtonVisibility ?? false,
304
308
  this._hasNotebookOpen()
305
309
  ))));
306
- this.searchInput.onKeyDown((keyboardEvent) => this.onSearchInputKeyDown(keyboardEvent));
310
+ this._register(this.searchInput.onKeyDown((keyboardEvent) => this.onSearchInputKeyDown(keyboardEvent)));
307
311
  this.searchInput.setValue(options.value || '');
308
312
  this.searchInput.setRegex(!!options.isRegex);
309
313
  this.searchInput.setCaseSensitive(!!options.isCaseSensitive);
@@ -381,7 +385,7 @@ let SearchWidget = class SearchWidget extends Widget {
381
385
  this.replaceInput = this._register(( (new ContextScopedReplaceInput(replaceBox, this.contextViewService, {
382
386
  label: ( localizeWithPath(_moduleId, 6, 'Replace: Type replace term and press Enter to preview')),
383
387
  placeholder: ( localizeWithPath(_moduleId, 7, "Replace")),
384
- appendPreserveCaseLabel: appendKeyBindingLabel('', this.keybindingService.lookupKeybinding("toggleSearchPreserveCase" )),
388
+ appendPreserveCaseLabel: appendKeyBindingLabel('', this.keybindingService.lookupKeybinding(SearchCommandIds.TogglePreserveCaseId)),
385
389
  history: options.replaceHistory,
386
390
  showHistoryHint: () => showHistoryKeybindingHint(this.keybindingService),
387
391
  flexibleHeight: true,
@@ -487,20 +491,20 @@ let SearchWidget = class SearchWidget extends Widget {
487
491
  }
488
492
  }
489
493
  onSearchInputKeyDown(keyboardEvent) {
490
- if (keyboardEvent.equals(ctrlKeyMod | 3 )) {
494
+ if (keyboardEvent.equals(ctrlKeyMod | KeyCode.Enter)) {
491
495
  this.searchInput?.inputBox.insertAtCursor('\n');
492
496
  keyboardEvent.preventDefault();
493
497
  }
494
- if (keyboardEvent.equals(3 )) {
498
+ if (keyboardEvent.equals(KeyCode.Enter)) {
495
499
  this.searchInput?.onSearchSubmit();
496
500
  this.submitSearch();
497
501
  keyboardEvent.preventDefault();
498
502
  }
499
- else if (keyboardEvent.equals(9 )) {
503
+ else if (keyboardEvent.equals(KeyCode.Escape)) {
500
504
  this._onSearchCancel.fire({ focus: true });
501
505
  keyboardEvent.preventDefault();
502
506
  }
503
- else if (keyboardEvent.equals(2 )) {
507
+ else if (keyboardEvent.equals(KeyCode.Tab)) {
504
508
  if (this.isReplaceShown()) {
505
509
  this.replaceInput?.focus();
506
510
  }
@@ -509,15 +513,15 @@ let SearchWidget = class SearchWidget extends Widget {
509
513
  }
510
514
  keyboardEvent.preventDefault();
511
515
  }
512
- else if (keyboardEvent.equals(16 )) {
516
+ else if (keyboardEvent.equals(KeyCode.UpArrow)) {
513
517
  stopPropagationForMultiLineUpwards(keyboardEvent, this.searchInput?.getValue() ?? '', this.searchInput?.domNode.querySelector('textarea') ?? null);
514
518
  }
515
- else if (keyboardEvent.equals(18 )) {
519
+ else if (keyboardEvent.equals(KeyCode.DownArrow)) {
516
520
  stopPropagationForMultiLineDownwards(keyboardEvent, this.searchInput?.getValue() ?? '', this.searchInput?.domNode.querySelector('textarea') ?? null);
517
521
  }
518
522
  }
519
523
  onCaseSensitiveKeyDown(keyboardEvent) {
520
- if (keyboardEvent.equals(1024 | 2 )) {
524
+ if (keyboardEvent.equals(KeyMod.Shift | KeyCode.Tab)) {
521
525
  if (this.isReplaceShown()) {
522
526
  this.replaceInput?.focus();
523
527
  keyboardEvent.preventDefault();
@@ -525,7 +529,7 @@ let SearchWidget = class SearchWidget extends Widget {
525
529
  }
526
530
  }
527
531
  onRegexKeyDown(keyboardEvent) {
528
- if (keyboardEvent.equals(2 )) {
532
+ if (keyboardEvent.equals(KeyCode.Tab)) {
529
533
  if (this.isReplaceShown()) {
530
534
  this.replaceInput?.focusOnPreserve();
531
535
  keyboardEvent.preventDefault();
@@ -533,7 +537,7 @@ let SearchWidget = class SearchWidget extends Widget {
533
537
  }
534
538
  }
535
539
  onPreserveCaseKeyDown(keyboardEvent) {
536
- if (keyboardEvent.equals(2 )) {
540
+ if (keyboardEvent.equals(KeyCode.Tab)) {
537
541
  if (this.isReplaceActive()) {
538
542
  this.focusReplaceAllAction();
539
543
  }
@@ -542,37 +546,37 @@ let SearchWidget = class SearchWidget extends Widget {
542
546
  }
543
547
  keyboardEvent.preventDefault();
544
548
  }
545
- else if (keyboardEvent.equals(1024 | 2 )) {
549
+ else if (keyboardEvent.equals(KeyMod.Shift | KeyCode.Tab)) {
546
550
  this.focusRegexAction();
547
551
  keyboardEvent.preventDefault();
548
552
  }
549
553
  }
550
554
  onReplaceInputKeyDown(keyboardEvent) {
551
- if (keyboardEvent.equals(ctrlKeyMod | 3 )) {
555
+ if (keyboardEvent.equals(ctrlKeyMod | KeyCode.Enter)) {
552
556
  this.replaceInput?.inputBox.insertAtCursor('\n');
553
557
  keyboardEvent.preventDefault();
554
558
  }
555
- if (keyboardEvent.equals(3 )) {
559
+ if (keyboardEvent.equals(KeyCode.Enter)) {
556
560
  this.submitSearch();
557
561
  keyboardEvent.preventDefault();
558
562
  }
559
- else if (keyboardEvent.equals(2 )) {
563
+ else if (keyboardEvent.equals(KeyCode.Tab)) {
560
564
  this.searchInput?.focusOnCaseSensitive();
561
565
  keyboardEvent.preventDefault();
562
566
  }
563
- else if (keyboardEvent.equals(1024 | 2 )) {
567
+ else if (keyboardEvent.equals(KeyMod.Shift | KeyCode.Tab)) {
564
568
  this.searchInput?.focus();
565
569
  keyboardEvent.preventDefault();
566
570
  }
567
- else if (keyboardEvent.equals(16 )) {
571
+ else if (keyboardEvent.equals(KeyCode.UpArrow)) {
568
572
  stopPropagationForMultiLineUpwards(keyboardEvent, this.replaceInput?.getValue() ?? '', this.replaceInput?.domNode.querySelector('textarea') ?? null);
569
573
  }
570
- else if (keyboardEvent.equals(18 )) {
574
+ else if (keyboardEvent.equals(KeyCode.DownArrow)) {
571
575
  stopPropagationForMultiLineDownwards(keyboardEvent, this.replaceInput?.getValue() ?? '', this.replaceInput?.domNode.querySelector('textarea') ?? null);
572
576
  }
573
577
  }
574
578
  onReplaceActionbarKeyDown(keyboardEvent) {
575
- if (keyboardEvent.equals(1024 | 2 )) {
579
+ if (keyboardEvent.equals(KeyMod.Shift | KeyCode.Tab)) {
576
580
  this.focusRegexAction();
577
581
  keyboardEvent.preventDefault();
578
582
  }
@@ -624,13 +628,13 @@ SearchWidget = SearchWidget_1 = ( (__decorate([
624
628
  function registerContributions() {
625
629
  KeybindingsRegistry.registerCommandAndKeybindingRule({
626
630
  id: ReplaceAllAction.ID,
627
- weight: 200 ,
631
+ weight: KeybindingWeight.WorkbenchContrib,
628
632
  when: ( (ContextKeyExpr.and(
629
633
  SearchContext.SearchViewVisibleKey,
630
634
  SearchContext.ReplaceActiveKey,
631
635
  CONTEXT_FIND_WIDGET_NOT_VISIBLE
632
636
  ))),
633
- primary: 512 | 2048 | 3 ,
637
+ primary: KeyMod.Alt | KeyMod.CtrlCmd | KeyCode.Enter,
634
638
  handler: accessor => {
635
639
  const viewsService = accessor.get(IViewsService);
636
640
  if (isSearchViewFocused(viewsService)) {
@@ -1,5 +1,6 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
3
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
3
4
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
4
5
  import { isEmptyObject } from 'vscode/vscode/vs/base/common/types';
5
6
 
@@ -13,12 +14,12 @@ let SearchHistoryService = class SearchHistoryService {
13
14
  this.onDidClearHistory = this._onDidClearHistory.event;
14
15
  }
15
16
  clearHistory() {
16
- this.storageService.remove(SearchHistoryService_1.SEARCH_HISTORY_KEY, 1 );
17
+ this.storageService.remove(SearchHistoryService_1.SEARCH_HISTORY_KEY, StorageScope.WORKSPACE);
17
18
  this._onDidClearHistory.fire();
18
19
  }
19
20
  load() {
20
21
  let result;
21
- const raw = this.storageService.get(SearchHistoryService_1.SEARCH_HISTORY_KEY, 1 );
22
+ const raw = this.storageService.get(SearchHistoryService_1.SEARCH_HISTORY_KEY, StorageScope.WORKSPACE);
22
23
  if (raw) {
23
24
  try {
24
25
  result = JSON.parse(raw);
@@ -30,10 +31,10 @@ let SearchHistoryService = class SearchHistoryService {
30
31
  }
31
32
  save(history) {
32
33
  if (isEmptyObject(history)) {
33
- this.storageService.remove(SearchHistoryService_1.SEARCH_HISTORY_KEY, 1 );
34
+ this.storageService.remove(SearchHistoryService_1.SEARCH_HISTORY_KEY, StorageScope.WORKSPACE);
34
35
  }
35
36
  else {
36
- this.storageService.store(SearchHistoryService_1.SEARCH_HISTORY_KEY, JSON.stringify(history), 1 , 0 );
37
+ this.storageService.store(SearchHistoryService_1.SEARCH_HISTORY_KEY, JSON.stringify(history), StorageScope.WORKSPACE, StorageTarget.USER);
37
38
  }
38
39
  }
39
40
  };
@@ -1,4 +1,5 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
2
3
  import { extname, isEqual } from 'vscode/vscode/vs/base/common/resources';
3
4
  import { URI } from 'vscode/vscode/vs/base/common/uri';
4
5
  import { ToggleCaseSensitiveKeybinding, ToggleWholeWordKeybinding, ToggleRegexKeybinding } from 'vscode/vscode/vs/editor/contrib/find/browser/findModel';
@@ -9,9 +10,10 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
9
10
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
10
11
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
11
12
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
13
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
12
14
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
13
15
  import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
14
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
16
+ import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
15
17
  import { EditorExtensions, DEFAULT_EDITOR_ASSOCIATION } from 'vscode/vscode/vs/workbench/common/editor';
16
18
  import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
17
19
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
@@ -69,7 +71,7 @@ SearchEditorContribution = ( (__decorate([
69
71
  ( (__param(0, IEditorResolverService))),
70
72
  ( (__param(1, IInstantiationService)))
71
73
  ], SearchEditorContribution)));
72
- registerWorkbenchContribution2(SearchEditorContribution.ID, SearchEditorContribution, 1 );
74
+ registerWorkbenchContribution2(SearchEditorContribution.ID, SearchEditorContribution, WorkbenchPhase.BlockStartup);
73
75
  class SearchEditorInputSerializer {
74
76
  canSerialize(input) {
75
77
  return !!input.tryReadConfigSync();
@@ -163,8 +165,8 @@ registerAction2(class extends Action2 {
163
165
  id: 'search.searchEditor.action.deleteFileResults',
164
166
  title: ( localize2WithPath(_moduleId, 3, 'Delete File Results')),
165
167
  keybinding: {
166
- weight: 100 ,
167
- primary: 2048 | 1024 | 1 ,
168
+ weight: KeybindingWeight.EditorContrib,
169
+ primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Backspace,
168
170
  },
169
171
  precondition: InSearchEditor,
170
172
  category,
@@ -228,11 +230,11 @@ registerAction2(class extends Action2 {
228
230
  category,
229
231
  f1: true,
230
232
  keybinding: {
231
- primary: 512 | 3 ,
233
+ primary: KeyMod.Alt | KeyCode.Enter,
232
234
  when: ( (ContextKeyExpr.and(SearchContext.HasSearchResults, SearchContext.SearchViewFocusedKey))),
233
- weight: 200 ,
235
+ weight: KeybindingWeight.WorkbenchContrib,
234
236
  mac: {
235
- primary: 2048 | 3
237
+ primary: KeyMod.CtrlCmd | KeyCode.Enter
236
238
  }
237
239
  },
238
240
  });
@@ -253,9 +255,9 @@ registerAction2(class extends Action2 {
253
255
  title: ( localize2WithPath(_moduleId, 8, 'Search Again')),
254
256
  category,
255
257
  keybinding: {
256
- primary: 2048 | 1024 | 48 ,
258
+ primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyR,
257
259
  when: InSearchEditor,
258
- weight: 100
260
+ weight: KeybindingWeight.EditorContrib
259
261
  },
260
262
  icon: searchRefreshIcon,
261
263
  menu: [{
@@ -286,8 +288,8 @@ registerAction2(class extends Action2 {
286
288
  f1: true,
287
289
  precondition: InSearchEditor,
288
290
  keybinding: {
289
- primary: 9 ,
290
- weight: 100
291
+ primary: KeyCode.Escape,
292
+ weight: KeybindingWeight.EditorContrib
291
293
  }
292
294
  });
293
295
  }
@@ -344,7 +346,7 @@ registerAction2(class extends Action2 {
344
346
  f1: true,
345
347
  precondition: InSearchEditor,
346
348
  keybinding: Object.assign({
347
- weight: 200 ,
349
+ weight: KeybindingWeight.WorkbenchContrib,
348
350
  when: SearchContext.SearchInputBoxFocusedKey,
349
351
  }, ToggleCaseSensitiveKeybinding)
350
352
  });
@@ -362,7 +364,7 @@ registerAction2(class extends Action2 {
362
364
  f1: true,
363
365
  precondition: InSearchEditor,
364
366
  keybinding: Object.assign({
365
- weight: 200 ,
367
+ weight: KeybindingWeight.WorkbenchContrib,
366
368
  when: SearchContext.SearchInputBoxFocusedKey,
367
369
  }, ToggleWholeWordKeybinding)
368
370
  });
@@ -380,7 +382,7 @@ registerAction2(class extends Action2 {
380
382
  f1: true,
381
383
  precondition: InSearchEditor,
382
384
  keybinding: Object.assign({
383
- weight: 200 ,
385
+ weight: KeybindingWeight.WorkbenchContrib,
384
386
  when: SearchContext.SearchInputBoxFocusedKey,
385
387
  }, ToggleRegexKeybinding)
386
388
  });
@@ -398,9 +400,9 @@ registerAction2(class extends Action2 {
398
400
  f1: true,
399
401
  precondition: InSearchEditor,
400
402
  keybinding: {
401
- weight: 200 ,
402
- primary: 512 | 42 ,
403
- mac: { primary: 2048 | 512 | 42 }
403
+ weight: KeybindingWeight.WorkbenchContrib,
404
+ primary: KeyMod.Alt | KeyCode.KeyL,
405
+ mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyL }
404
406
  }
405
407
  });
406
408
  }
@@ -417,8 +419,8 @@ registerAction2(class extends Action2 {
417
419
  f1: true,
418
420
  precondition: InSearchEditor,
419
421
  keybinding: {
420
- weight: 200 ,
421
- primary: 512 | 86
422
+ weight: KeybindingWeight.WorkbenchContrib,
423
+ primary: KeyMod.Alt | KeyCode.Equal
422
424
  }
423
425
  });
424
426
  }
@@ -433,8 +435,8 @@ registerAction2(class extends Action2 {
433
435
  f1: true,
434
436
  precondition: InSearchEditor,
435
437
  keybinding: {
436
- weight: 200 ,
437
- primary: 512 | 88
438
+ weight: KeybindingWeight.WorkbenchContrib,
439
+ primary: KeyMod.Alt | KeyCode.Minus
438
440
  }
439
441
  });
440
442
  }
@@ -449,8 +451,8 @@ registerAction2(class extends Action2 {
449
451
  f1: true,
450
452
  precondition: InSearchEditor,
451
453
  keybinding: {
452
- weight: 200 ,
453
- primary: 2048 | 1024 | 42 ,
454
+ weight: KeybindingWeight.WorkbenchContrib,
455
+ primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyL,
454
456
  }
455
457
  });
456
458
  }
@@ -503,4 +505,4 @@ SearchEditorWorkingCopyEditorHandler = ( (__decorate([
503
505
  ( (__param(0, IInstantiationService))),
504
506
  ( (__param(1, IWorkingCopyEditorService)))
505
507
  ], SearchEditorWorkingCopyEditorHandler)));
506
- registerWorkbenchContribution2(SearchEditorWorkingCopyEditorHandler.ID, SearchEditorWorkingCopyEditorHandler, 2 );
508
+ registerWorkbenchContribution2(SearchEditorWorkingCopyEditorHandler.ID, SearchEditorWorkingCopyEditorHandler, WorkbenchPhase.BlockRestore);
@@ -3,6 +3,7 @@ import { $, append, addDisposableListener, EventType, EventHelper, clearNode, ge
3
3
  import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
4
4
  import { alert } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
5
5
  import { Delayer } from 'vscode/vscode/vs/base/common/async';
6
+ import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
6
7
  import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
7
8
  import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
8
9
  import './media/searchEditor.css.js';
@@ -39,6 +40,7 @@ import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeServi
39
40
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
40
41
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
41
42
  import { AbstractTextCodeEditor } from 'vscode/vscode/vs/workbench/browser/parts/editor/textCodeEditor';
43
+ import { EditorInputCapabilities } from 'vscode/vscode/vs/workbench/common/editor';
42
44
  import { IncludePatternInputWidget, ExcludePatternInputWidget } from '../../search/browser/patternInputWidget.js';
43
45
  import { SearchWidget } from '../../search/browser/searchWidget.js';
44
46
  import { QueryBuilder } from 'vscode/vscode/vs/workbench/services/search/common/queryBuilder';
@@ -48,6 +50,7 @@ import { SearchEditorID, InSearchEditor, SearchEditorInputTypeId } from 'vscode/
48
50
  import { serializeSearchResultForEditor } from './searchEditorSerialization.js';
49
51
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
50
52
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
53
+ import { SearchSortOrder } from 'vscode/vscode/vs/workbench/services/search/common/search';
51
54
  import { searchDetailsIcon } from '../../search/browser/searchIcons.js';
52
55
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
53
56
  import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
@@ -125,14 +128,14 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
125
128
  }));
126
129
  this._register(addDisposableListener(this.toggleQueryDetailsButton, EventType.KEY_UP, (e) => {
127
130
  const event = ( (new StandardKeyboardEvent(e)));
128
- if (event.equals(3 ) || event.equals(10 )) {
131
+ if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
129
132
  EventHelper.stop(e);
130
133
  this.toggleIncludesExcludes();
131
134
  }
132
135
  }));
133
136
  this._register(addDisposableListener(this.toggleQueryDetailsButton, EventType.KEY_DOWN, (e) => {
134
137
  const event = ( (new StandardKeyboardEvent(e)));
135
- if (event.equals(1024 | 2 )) {
138
+ if (event.equals(KeyMod.Shift | KeyCode.Tab)) {
136
139
  if (this.queryEditorWidget.isReplaceActive()) {
137
140
  this.queryEditorWidget.focusReplaceAllAction();
138
141
  }
@@ -524,7 +527,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
524
527
  }
525
528
  input.ongoingSearchOperation = undefined;
526
529
  const sortOrder = this.searchConfig.sortOrder;
527
- if (sortOrder === "modified" ) {
530
+ if (sortOrder === SearchSortOrder.Modified) {
528
531
  await this.retrieveFileStats(this.searchModel.searchResult);
529
532
  }
530
533
  const controller = ReferencesController.get(this.searchResultEditor);
@@ -541,7 +544,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
541
544
  }
542
545
  }
543
546
  this.reLayout();
544
- input.setDirty(!input.hasCapability(4 ));
547
+ input.setDirty(!input.hasCapability(EditorInputCapabilities.Untitled));
545
548
  input.setMatchRanges(results.matchRanges);
546
549
  }
547
550
  addMessage(message) {
@@ -6,6 +6,7 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/c
6
6
  import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
7
7
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
8
8
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
9
+ import { EditorsOrder } from 'vscode/vscode/vs/workbench/common/editor';
9
10
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
10
11
  import { getSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
11
12
  import { SearchEditorInput, getOrMakeSearchEditorInput } from './searchEditorInput.js';
@@ -129,7 +130,7 @@ const openNewSearchEditor = async (accessor, _args = {}, toSide = false) => {
129
130
  args[name] = (typeof value === 'string') ? await configurationResolverService.resolveAsync(lastActiveWorkspaceRoot, value) : value;
130
131
  }
131
132
  }
132
- const existing = editorService.getEditors(0 ).find(id => id.editor.typeId === SearchEditorInput.ID);
133
+ const existing = editorService.getEditors(EditorsOrder.MOST_RECENTLY_ACTIVE).find(id => id.editor.typeId === SearchEditorInput.ID);
133
134
  let editor;
134
135
  if (existing && args.location === 'reuse') {
135
136
  const group = editorGroupsService.getGroup(existing.groupId);
@@ -4,13 +4,15 @@ import { Emitter } from 'vscode/vscode/vs/base/common/event';
4
4
  import { basename } from 'vscode/vscode/vs/base/common/path';
5
5
  import { isEqual, extname, joinPath } from 'vscode/vscode/vs/base/common/resources';
6
6
  import { URI } from 'vscode/vscode/vs/base/common/uri';
7
+ import { TrackedRangeStickiness } from 'vscode/vscode/vs/editor/common/model';
7
8
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
8
9
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
9
10
  import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
10
11
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
12
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
11
13
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
12
14
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
13
- import { EditorResourceAccessor } from 'vscode/vscode/vs/workbench/common/editor';
15
+ import { EditorInputCapabilities, EditorResourceAccessor } from 'vscode/vscode/vs/workbench/common/editor';
14
16
  import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
15
17
  import { SearchEditorInputTypeId, SearchEditorScheme, SearchEditorWorkingCopyTypeId, SearchEditorFindMatchClass } from 'vscode/vscode/vs/workbench/contrib/searchEditor/browser/constants';
16
18
  import { SearchEditorModel, searchEditorModelFactory } from './searchEditorModel.js';
@@ -18,6 +20,7 @@ import { serializeSearchConfiguration, parseSavedSearchEditor, defaultSearchConf
18
20
  import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
19
21
  import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
20
22
  import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
23
+ import { WorkingCopyCapabilities } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopy';
21
24
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
22
25
  import { bufferToReadable, VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
23
26
  import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
@@ -41,9 +44,9 @@ let SearchEditorInput = class SearchEditorInput extends EditorInput {
41
44
  return SearchEditorIcon;
42
45
  }
43
46
  get capabilities() {
44
- let capabilities = 8 ;
47
+ let capabilities = EditorInputCapabilities.Singleton;
45
48
  if (!this.backingUri) {
46
- capabilities |= 4 ;
49
+ capabilities |= EditorInputCapabilities.Untitled;
47
50
  }
48
51
  return capabilities;
49
52
  }
@@ -78,7 +81,7 @@ let SearchEditorInput = class SearchEditorInput extends EditorInput {
78
81
  constructor() {
79
82
  this.typeId = SearchEditorWorkingCopyTypeId;
80
83
  this.resource = input.modelUri;
81
- this.capabilities = input.hasCapability(4 ) ? 2 : 0 ;
84
+ this.capabilities = input.hasCapability(EditorInputCapabilities.Untitled) ? WorkingCopyCapabilities.Untitled : WorkingCopyCapabilities.None;
82
85
  this.onDidChangeDirty = input.onDidChangeDirty;
83
86
  this.onDidChangeContent = input.onDidChangeContent;
84
87
  this.onDidSave = input.onDidSave;
@@ -121,7 +124,7 @@ let SearchEditorInput = class SearchEditorInput extends EditorInput {
121
124
  this._onDidChangeLabel.fire();
122
125
  this.lastLabel = this.getName();
123
126
  }
124
- this.memento.getMemento(1 , 1 ).searchConfig = model.config;
127
+ this.memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE).searchConfig = model.config;
125
128
  });
126
129
  this._register(this.configChangeListenerDisposable);
127
130
  }
@@ -213,7 +216,7 @@ let SearchEditorInput = class SearchEditorInput extends EditorInput {
213
216
  }
214
217
  async setMatchRanges(ranges) {
215
218
  this.oldDecorationsIDs = (await this.resolveModels()).resultsModel.deltaDecorations(this.oldDecorationsIDs, ( (ranges.map(
216
- range => ({ range, options: { description: 'search-editor-find-match', className: SearchEditorFindMatchClass, stickiness: 1 } })
219
+ range => ({ range, options: { description: 'search-editor-find-match', className: SearchEditorFindMatchClass, stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges } })
217
220
  ))));
218
221
  }
219
222
  async revert(group, options) {
@@ -248,7 +251,7 @@ let SearchEditorInput = class SearchEditorInput extends EditorInput {
248
251
  return joinPath(await this.fileDialogService.defaultFilePath(this.pathService.defaultUriScheme), searchFileName);
249
252
  }
250
253
  toUntyped() {
251
- if (this.hasCapability(4 )) {
254
+ if (this.hasCapability(EditorInputCapabilities.Untitled)) {
252
255
  return undefined;
253
256
  }
254
257
  return {
@@ -282,7 +285,7 @@ const getOrMakeSearchEditorInput = (accessor, existingData) => {
282
285
  const searchEditorSettings = configurationService.getValue('search').searchEditor;
283
286
  const reuseOldSettings = searchEditorSettings.reusePriorSearchConfiguration;
284
287
  const defaultNumberOfContextLines = searchEditorSettings.defaultNumberOfContextLines;
285
- const priorConfig = reuseOldSettings ? ( (new Memento(SearchEditorInput.ID, storageService))).getMemento(1 , 1 ).searchConfig : {};
288
+ const priorConfig = reuseOldSettings ? ( (new Memento(SearchEditorInput.ID, storageService))).getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE).searchConfig : {};
286
289
  const defaultConfig = defaultSearchConfig();
287
290
  const config = { ...defaultConfig, ...priorConfig, ...existingData.config };
288
291
  if (defaultNumberOfContextLines !== null && defaultNumberOfContextLines !== undefined) {
@@ -1,4 +1,4 @@
1
- import { coalesce, flatten } from 'vscode/vscode/vs/base/common/arrays';
1
+ import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
2
2
  import './media/searchEditor.css.js';
3
3
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
4
4
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
@@ -227,9 +227,9 @@ const serializeSearchResultForEditor = (searchResult, rawIncludePattern, rawExcl
227
227
  }
228
228
  info.push('');
229
229
  const matchComparer = (a, b) => searchMatchComparer(a, b, sortOrder);
230
- const allResults = flattenSearchResultSerializations(flatten(( (searchResult.folderMatches().sort(matchComparer)
230
+ const allResults = flattenSearchResultSerializations(( (searchResult.folderMatches().sort(matchComparer)
231
231
  .map(folderMatch => folderMatch.allDownstreamFileMatches().sort(matchComparer)
232
- .flatMap(fileMatch => fileMatchToSearchResultFormat(fileMatch, labelFormatter)))))));
232
+ .flatMap(fileMatch => fileMatchToSearchResultFormat(fileMatch, labelFormatter))))).flat());
233
233
  return {
234
234
  matchRanges: ( (allResults.matchRanges.map(translateRangeLines(info.length)))),
235
235
  text: info.concat(allResults.text).join(lineDelimiter),