@codingame/monaco-vscode-search-service-override 2.2.2 → 3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-search-service-override",
3
- "version": "2.2.2",
3
+ "version": "3.1.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@2.2.2",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@3.1.0",
22
22
  "vscode-marked": "npm:marked@=3.0.2"
23
23
  }
24
24
  }
@@ -23,6 +23,8 @@ import { VIEW_ID } from 'vscode/vscode/vs/workbench/services/search/common/searc
23
23
  import { Event } from 'vscode/vscode/vs/base/common/event';
24
24
  import { EditorViewState } from 'vscode/vscode/vs/workbench/browser/quickaccess';
25
25
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
26
+ import { IHistoryService } from 'vscode/vscode/vs/workbench/services/history/common/history';
27
+ import { Sequencer } from 'vscode/vscode/vs/base/common/async';
26
28
 
27
29
  const TEXT_SEARCH_QUICK_ACCESS_PREFIX = '%';
28
30
  const DEFAULT_TEXT_QUERY_BUILDER_OPTIONS = {
@@ -49,7 +51,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
49
51
  }
50
52
  };
51
53
  }
52
- constructor(_instantiationService, _contextService, _editorService, _labelService, _viewsService, _configurationService) {
54
+ constructor(_instantiationService, _contextService, _editorService, _labelService, _viewsService, _configurationService, _historyService) {
53
55
  super(TEXT_SEARCH_QUICK_ACCESS_PREFIX, { canAcceptInBackground: true, shouldSkipTrimPickFilter: true });
54
56
  this._instantiationService = _instantiationService;
55
57
  this._contextService = _contextService;
@@ -57,6 +59,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
57
59
  this._labelService = _labelService;
58
60
  this._viewsService = _viewsService;
59
61
  this._configurationService = _configurationService;
62
+ this._historyService = _historyService;
60
63
  this.currentAsyncSearch = Promise.resolve({
61
64
  results: [],
62
65
  messages: []
@@ -65,6 +68,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
65
68
  this.queryBuilder = this._instantiationService.createInstance(QueryBuilder);
66
69
  this.searchModel = this._instantiationService.createInstance(SearchModel);
67
70
  this.searchModel.location = SearchModelLocation.QUICK_ACCESS;
71
+ this.editorSequencer = ( new Sequencer());
68
72
  }
69
73
  dispose() {
70
74
  this.searchModel.dispose();
@@ -91,15 +95,24 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
91
95
  const [item] = picker.activeItems;
92
96
  if (item?.match) {
93
97
  this.editorViewState.set();
94
- this._editorService.openEditor({
95
- resource: item.match.parent().resource,
96
- options: { preserveFocus: true, revealIfOpened: true, ignoreError: true, selection: item.match.range() }
98
+ const itemMatch = item.match;
99
+ this.editorSequencer.queue(async () => {
100
+ const disposable = this._historyService.suspendTracking();
101
+ try {
102
+ await this._editorService.openEditor({
103
+ resource: itemMatch.parent().resource,
104
+ options: { preserveFocus: true, revealIfOpened: true, ignoreError: true, selection: itemMatch.range() }
105
+ });
106
+ }
107
+ finally {
108
+ disposable.dispose();
109
+ }
97
110
  });
98
111
  }
99
112
  }));
100
113
  disposables.add(Event.once(picker.onDidHide)(({ reason }) => {
101
114
  if (reason === QuickInputHideReason.Gesture) {
102
- this.editorViewState.restore();
115
+ this.editorViewState.restore(true);
103
116
  }
104
117
  this.searchModel.searchResult.toggleHighlights(false);
105
118
  }));
@@ -322,7 +335,8 @@ TextSearchQuickAccess = ( __decorate([
322
335
  ( __param(2, IEditorService)),
323
336
  ( __param(3, ILabelService)),
324
337
  ( __param(4, IViewsService)),
325
- ( __param(5, IConfigurationService))
338
+ ( __param(5, IConfigurationService)),
339
+ ( __param(6, IHistoryService))
326
340
  ], TextSearchQuickAccess));
327
341
 
328
342
  export { TEXT_SEARCH_QUICK_ACCESS_PREFIX, TextSearchQuickAccess };
@@ -1,9 +1,8 @@
1
1
  import { ReplacePreviewContentProvider } from './replaceService.js';
2
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
3
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
2
+ import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
4
3
 
5
4
  function registerContributions() {
6
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ReplacePreviewContentProvider, 1 );
5
+ registerWorkbenchContribution2(ReplacePreviewContentProvider.ID, ReplacePreviewContentProvider, 1 );
7
6
  }
8
7
 
9
8
  export { registerContributions };
@@ -30,6 +30,7 @@ const toFileResource = (replaceResource) => {
30
30
  return replaceResource.with({ scheme: JSON.parse(replaceResource.query)['scheme'], fragment: '', query: '' });
31
31
  };
32
32
  let ReplacePreviewContentProvider = class ReplacePreviewContentProvider {
33
+ static { this.ID = 'workbench.contrib.replacePreviewContentProvider'; }
33
34
  constructor(instantiationService, textModelResolverService) {
34
35
  this.instantiationService = instantiationService;
35
36
  this.textModelResolverService = textModelResolverService;
@@ -1,31 +1,25 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
1
  import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
3
2
  import { AbstractGotoLineQuickAccessProvider } from 'vscode/vscode/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess';
4
3
  import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
5
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
6
- import { Extensions as Extensions$3 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
4
+ import { Extensions as Extensions$2 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
7
5
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
8
6
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
9
- import { Extensions as Extensions$2 } from 'vscode/vscode/vs/platform/quickinput/common/quickAccess';
7
+ import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/quickinput/common/quickAccess';
10
8
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
11
9
  import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
12
10
  import { defaultQuickAccessContextKeyValue } from 'vscode/vscode/vs/workbench/browser/quickaccess';
13
- import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
14
- import { Extensions, IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
11
+ import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
15
12
  import { GotoSymbolQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess';
16
13
  import { AnythingQuickAccessProvider } from './anythingQuickAccess.js';
17
14
  import { registerContributions } from './replaceContributions.js';
18
- import { registerContributions as registerContributions$1 } from './notebookSearch/notebookSearchContributions.js';
19
15
  import { searchViewIcon } from './searchIcons.js';
20
16
  import { SearchView } from './searchView.js';
21
- import { registerContributions as registerContributions$2 } from './searchWidget.js';
17
+ import { registerContributions as registerContributions$1 } from './searchWidget.js';
22
18
  import { SymbolsQuickAccessProvider } from './symbolsQuickAccess.js';
23
19
  import { VIEWLET_ID, VIEW_ID, SEARCH_EXCLUDE_CONFIG } from 'vscode/vscode/vs/workbench/services/search/common/search';
24
- import { Extensions as Extensions$4 } from 'vscode/vscode/vs/workbench/common/configuration';
25
20
  import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
26
21
  import { assertType } from 'vscode/vscode/vs/base/common/types';
27
22
  import { getWorkspaceSymbols } from 'vscode/vscode/vs/workbench/contrib/search/common/search';
28
- import { ShowAllSymbolsActionId, QuickTextSearchActionId } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
29
23
  import './searchActionsCopy.js';
30
24
  import 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsFind';
31
25
  import './searchActionsNav.js';
@@ -37,7 +31,6 @@ import { TextSearchQuickAccess, TEXT_SEARCH_QUICK_ACCESS_PREFIX } from './quickT
37
31
 
38
32
  registerContributions();
39
33
  registerContributions$1();
40
- registerContributions$2();
41
34
  const SEARCH_MODE_CONFIG = 'search.mode';
42
35
  const viewContainer = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
43
36
  id: VIEWLET_ID,
@@ -80,22 +73,7 @@ const viewDescriptor = {
80
73
  }
81
74
  };
82
75
  ( Registry.as(Extensions.ViewsRegistry)).registerViews([viewDescriptor], viewContainer);
83
- let RegisterSearchViewContribution = class RegisterSearchViewContribution {
84
- constructor(configurationService, viewDescriptorService) {
85
- const data = configurationService.inspect('search.location');
86
- if (data.value === 'panel') {
87
- viewDescriptorService.moveViewToLocation(viewDescriptor, 1 , 'search.location');
88
- }
89
- ( Registry.as(Extensions$4.ConfigurationMigration))
90
- .registerConfigurationMigrations([{ key: 'search.location', migrateFn: (value) => ({ value: undefined }) }]);
91
- }
92
- };
93
- RegisterSearchViewContribution = ( __decorate([
94
- ( __param(0, IConfigurationService)),
95
- ( __param(1, IViewDescriptorService))
96
- ], RegisterSearchViewContribution));
97
- ( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(RegisterSearchViewContribution, 1 );
98
- const quickAccessRegistry = ( Registry.as(Extensions$2.Quickaccess));
76
+ const quickAccessRegistry = ( Registry.as(Extensions$1.Quickaccess));
99
77
  quickAccessRegistry.registerQuickAccessProvider({
100
78
  ctor: AnythingQuickAccessProvider,
101
79
  prefix: AnythingQuickAccessProvider.PREFIX,
@@ -130,7 +108,7 @@ quickAccessRegistry.registerQuickAccessProvider({
130
108
  'vs/workbench/contrib/search/browser/search.contribution',
131
109
  'symbolsQuickAccess',
132
110
  "Go to Symbol in Workspace"
133
- )), commandId: ShowAllSymbolsActionId }]
111
+ )), commandId: "workbench.action.showAllSymbols" }]
134
112
  });
135
113
  quickAccessRegistry.registerQuickAccessProvider({
136
114
  ctor: TextSearchQuickAccess,
@@ -148,12 +126,12 @@ quickAccessRegistry.registerQuickAccessProvider({
148
126
  'textSearchPickerHelp',
149
127
  "Search for Text (Experimental)"
150
128
  )),
151
- commandId: QuickTextSearchActionId,
129
+ commandId: "workbench.action.experimental.quickTextSearch" ,
152
130
  commandCenterOrder: 65,
153
131
  }
154
132
  ]
155
133
  });
156
- const configurationRegistry = ( Registry.as(Extensions$3.Configuration));
134
+ const configurationRegistry = ( Registry.as(Extensions$2.Configuration));
157
135
  configurationRegistry.registerConfiguration({
158
136
  id: 'search',
159
137
  order: 13,
@@ -1,8 +1,8 @@
1
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
1
+ import { localize2WithPath } from 'vscode/vscode/vs/nls';
2
2
  import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
3
3
  import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
4
4
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
5
- import { CopyMatchCommandId, FileMatchOrMatchFocusKey, CopyPathCommandId, FileMatchOrFolderMatchWithResourceFocusKey, CopyAllCommandId, HasSearchResults } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
5
+ import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
6
6
  import { FileMatch, FolderMatchWithResource, Match, FolderMatch, searchMatchComparer } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
7
7
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
8
8
  import { category, getSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
@@ -11,24 +11,21 @@ import { isWindows } from 'vscode/vscode/vs/base/common/platform';
11
11
  registerAction2(class CopyMatchCommandAction extends Action2 {
12
12
  constructor() {
13
13
  super({
14
- id: CopyMatchCommandId,
15
- title: {
16
- value: ( localizeWithPath(
17
- 'vs/workbench/contrib/search/browser/searchActionsCopy',
18
- 'copyMatchLabel',
19
- "Copy"
20
- )),
21
- original: 'Copy'
22
- },
14
+ id: "search.action.copyMatch" ,
15
+ title: ( localize2WithPath(
16
+ 'vs/workbench/contrib/search/browser/searchActionsCopy',
17
+ 'copyMatchLabel',
18
+ "Copy"
19
+ )),
23
20
  category,
24
21
  keybinding: {
25
22
  weight: 200 ,
26
- when: FileMatchOrMatchFocusKey,
23
+ when: SearchContext.FileMatchOrMatchFocusKey,
27
24
  primary: 2048 | 33 ,
28
25
  },
29
26
  menu: [{
30
27
  id: MenuId.SearchContext,
31
- when: FileMatchOrMatchFocusKey,
28
+ when: SearchContext.FileMatchOrMatchFocusKey,
32
29
  group: 'search_2',
33
30
  order: 1
34
31
  }]
@@ -41,19 +38,16 @@ registerAction2(class CopyMatchCommandAction extends Action2 {
41
38
  registerAction2(class CopyPathCommandAction extends Action2 {
42
39
  constructor() {
43
40
  super({
44
- id: CopyPathCommandId,
45
- title: {
46
- value: ( localizeWithPath(
47
- 'vs/workbench/contrib/search/browser/searchActionsCopy',
48
- 'copyPathLabel',
49
- "Copy Path"
50
- )),
51
- original: 'Copy Path'
52
- },
41
+ id: "search.action.copyPath" ,
42
+ title: ( localize2WithPath(
43
+ 'vs/workbench/contrib/search/browser/searchActionsCopy',
44
+ 'copyPathLabel',
45
+ "Copy Path"
46
+ )),
53
47
  category,
54
48
  keybinding: {
55
49
  weight: 200 ,
56
- when: FileMatchOrFolderMatchWithResourceFocusKey,
50
+ when: SearchContext.FileMatchOrFolderMatchWithResourceFocusKey,
57
51
  primary: 2048 | 512 | 33 ,
58
52
  win: {
59
53
  primary: 1024 | 512 | 33
@@ -61,7 +55,7 @@ registerAction2(class CopyPathCommandAction extends Action2 {
61
55
  },
62
56
  menu: [{
63
57
  id: MenuId.SearchContext,
64
- when: FileMatchOrFolderMatchWithResourceFocusKey,
58
+ when: SearchContext.FileMatchOrFolderMatchWithResourceFocusKey,
65
59
  group: 'search_2',
66
60
  order: 2
67
61
  }]
@@ -74,19 +68,16 @@ registerAction2(class CopyPathCommandAction extends Action2 {
74
68
  registerAction2(class CopyAllCommandAction extends Action2 {
75
69
  constructor() {
76
70
  super({
77
- id: CopyAllCommandId,
78
- title: {
79
- value: ( localizeWithPath(
80
- 'vs/workbench/contrib/search/browser/searchActionsCopy',
81
- 'copyAllLabel',
82
- "Copy All"
83
- )),
84
- original: 'Copy All'
85
- },
71
+ id: "search.action.copyAll" ,
72
+ title: ( localize2WithPath(
73
+ 'vs/workbench/contrib/search/browser/searchActionsCopy',
74
+ 'copyAllLabel',
75
+ "Copy All"
76
+ )),
86
77
  category,
87
78
  menu: [{
88
79
  id: MenuId.SearchContext,
89
- when: HasSearchResults,
80
+ when: SearchContext.HasSearchResults,
90
81
  group: 'search_2',
91
82
  order: 3
92
83
  }]