@codingame/monaco-vscode-search-service-override 37.2.0 → 37.3.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 (30) hide show
  1. package/common.d.ts +2 -0
  2. package/common.js +84 -0
  3. package/index.js +3 -76
  4. package/package.json +10 -2
  5. package/session.d.ts +2 -0
  6. package/session.js +10 -0
  7. package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +13 -9
  8. package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +39 -39
  9. package/vscode/src/vs/workbench/contrib/search/browser/searchAccessibilityHelp.js +55 -55
  10. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +7 -7
  11. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +17 -17
  12. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +17 -17
  13. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +4 -4
  14. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +1 -1
  15. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/searchResult.js +2 -2
  16. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +30 -30
  17. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +16 -16
  18. package/vscode/src/vs/workbench/services/search/browser/searchService.js +6 -6
  19. package/vscode/src/vs/workbench/services/search/common/searchService.js +4 -4
  20. package/vscode/src/vs/workbench/services/search/worker/localFileSearch.js +12 -10
  21. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.d.ts +0 -1
  22. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +0 -15
  23. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.d.ts +0 -40
  24. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +0 -264
  25. package/vscode/src/vs/workbench/contrib/search/browser/search.common.contribution.d.ts +0 -1
  26. package/vscode/src/vs/workbench/contrib/search/browser/search.common.contribution.js +0 -148
  27. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.d.ts +0 -1
  28. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +0 -41
  29. package/vscode/src/vs/workbench/contrib/search/browser/searchQuickAccess.contribution.d.ts +0 -1
  30. package/vscode/src/vs/workbench/contrib/search/browser/searchQuickAccess.contribution.js +0 -38
@@ -1,264 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
4
- import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
5
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
- import { IReplaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/replace.service';
7
- import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
8
- import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
9
- import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
10
- import { ISearchViewModelWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/searchTreeModel/searchViewModelWorkbenchService.service';
11
- import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
12
- import { ScrollType } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorCommon';
13
- import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
14
- import { createTextBufferFactoryFromSnapshot } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
15
- import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
16
- import { ResourceTextEdit } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService';
17
- import { IBulkEditService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService.service';
18
- import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
19
- import { EditOperation } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/editOperation';
20
- import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
21
- import { dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
22
- import { Promises } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
23
- import { SaveSourceRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
24
- import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
25
- import { INotebookEditorModelResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service';
26
- import { isSearchTreeMatch, isSearchTreeFileMatch } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/searchTreeModel/searchTreeCommon';
27
- import { isIMatchInNotebook } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModelBase';
28
-
29
- var ReplaceService_1;
30
- const REPLACE_PREVIEW = "replacePreview";
31
- const toReplaceResource = fileResource => {
32
- return fileResource.with({
33
- scheme: Schemas.internal,
34
- fragment: REPLACE_PREVIEW,
35
- query: JSON.stringify({
36
- scheme: fileResource.scheme
37
- })
38
- });
39
- };
40
- const toFileResource = replaceResource => {
41
- return replaceResource.with({
42
- scheme: JSON.parse(replaceResource.query)["scheme"],
43
- fragment: "",
44
- query: ""
45
- });
46
- };
47
- let ReplacePreviewContentProvider = class ReplacePreviewContentProvider {
48
- static {
49
- this.ID = "workbench.contrib.replacePreviewContentProvider";
50
- }
51
- constructor(instantiationService, textModelResolverService) {
52
- this.instantiationService = instantiationService;
53
- this.textModelResolverService = textModelResolverService;
54
- this.textModelResolverService.registerTextModelContentProvider(Schemas.internal, this);
55
- }
56
- provideTextContent(uri) {
57
- if (uri.fragment === REPLACE_PREVIEW) {
58
- return this.instantiationService.createInstance(ReplacePreviewModel).resolve(uri);
59
- }
60
- return null;
61
- }
62
- };
63
- ReplacePreviewContentProvider = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, ITextModelService))], ReplacePreviewContentProvider));
64
- let ReplacePreviewModel = class ReplacePreviewModel extends Disposable {
65
- constructor(
66
- modelService,
67
- languageService,
68
- textModelResolverService,
69
- replaceService,
70
- searchWorkbenchService
71
- ) {
72
- super();
73
- this.modelService = modelService;
74
- this.languageService = languageService;
75
- this.textModelResolverService = textModelResolverService;
76
- this.replaceService = replaceService;
77
- this.searchWorkbenchService = searchWorkbenchService;
78
- }
79
- async resolve(replacePreviewUri) {
80
- const fileResource = toFileResource(replacePreviewUri);
81
- const fileMatch = this.searchWorkbenchService.searchModel.searchResult.matches(false).filter(match => ( match.resource.toString()) === ( fileResource.toString()))[0];
82
- const ref = this._register(await this.textModelResolverService.createModelReference(fileResource));
83
- const sourceModel = ref.object.textEditorModel;
84
- const sourceModelLanguageId = sourceModel.getLanguageId();
85
- const replacePreviewModel = this.modelService.createModel(
86
- createTextBufferFactoryFromSnapshot(sourceModel.createSnapshot()),
87
- this.languageService.createById(sourceModelLanguageId),
88
- replacePreviewUri
89
- );
90
- this._register(fileMatch.onChange((
91
- {
92
- forceUpdateModel
93
- }
94
- ) => this.update(sourceModel, replacePreviewModel, fileMatch, forceUpdateModel)));
95
- this._register(
96
- this.searchWorkbenchService.searchModel.onReplaceTermChanged(() => this.update(sourceModel, replacePreviewModel, fileMatch))
97
- );
98
- this._register(fileMatch.onDispose(() => replacePreviewModel.dispose()));
99
- this._register(replacePreviewModel.onWillDispose(() => this.dispose()));
100
- this._register(sourceModel.onWillDispose(() => this.dispose()));
101
- return replacePreviewModel;
102
- }
103
- update(sourceModel, replacePreviewModel, fileMatch, override = false) {
104
- if (!sourceModel.isDisposed() && !replacePreviewModel.isDisposed()) {
105
- this.replaceService.updateReplacePreview(fileMatch, override);
106
- }
107
- }
108
- };
109
- ReplacePreviewModel = ( __decorate([( __param(0, IModelService)), ( __param(1, ILanguageService)), ( __param(2, ITextModelService)), ( __param(3, IReplaceService)), ( __param(4, ISearchViewModelWorkbenchService))], ReplacePreviewModel));
110
- let ReplaceService = class ReplaceService {
111
- static {
112
- ReplaceService_1 = this;
113
- }
114
- static {
115
- this.REPLACE_SAVE_SOURCE = SaveSourceRegistry.registerSource("searchReplace.source", ( localize(15887, "Search and Replace")));
116
- }
117
- constructor(
118
- textFileService,
119
- editorService,
120
- textModelResolverService,
121
- bulkEditorService,
122
- labelService,
123
- notebookEditorModelResolverService
124
- ) {
125
- this.textFileService = textFileService;
126
- this.editorService = editorService;
127
- this.textModelResolverService = textModelResolverService;
128
- this.bulkEditorService = bulkEditorService;
129
- this.labelService = labelService;
130
- this.notebookEditorModelResolverService = notebookEditorModelResolverService;
131
- }
132
- async replace(arg, progress = undefined, resource = null) {
133
- const edits = this.createEdits(arg, resource);
134
- await this.bulkEditorService.apply(edits, {
135
- progress
136
- });
137
- const rawTextPromises = ( edits.map(async e => {
138
- if (e.resource.scheme === Schemas.vscodeNotebookCell) {
139
- const notebookResource = CellUri.parse(e.resource)?.notebook;
140
- if (notebookResource) {
141
- let ref;
142
- try {
143
- ref = await this.notebookEditorModelResolverService.resolve(notebookResource);
144
- await ref.object.save({
145
- source: ReplaceService_1.REPLACE_SAVE_SOURCE
146
- });
147
- } finally {
148
- ref?.dispose();
149
- }
150
- }
151
- return;
152
- } else {
153
- return this.textFileService.files.get(e.resource)?.save({
154
- source: ReplaceService_1.REPLACE_SAVE_SOURCE
155
- });
156
- }
157
- }));
158
- return Promises.settled(rawTextPromises);
159
- }
160
- async openReplacePreview(element, preserveFocus, sideBySide, pinned) {
161
- const fileMatch = isSearchTreeMatch(element) ? element.parent() : element;
162
- const editor = await this.editorService.openEditor({
163
- original: {
164
- resource: fileMatch.resource
165
- },
166
- modified: {
167
- resource: toReplaceResource(fileMatch.resource)
168
- },
169
- label: ( localize(15888, "{0} ↔ {1} (Replace Preview)", fileMatch.name(), fileMatch.name())),
170
- description: this.labelService.getUriLabel(dirname(fileMatch.resource), {
171
- relative: true
172
- }),
173
- options: {
174
- preserveFocus,
175
- pinned,
176
- revealIfVisible: true
177
- }
178
- });
179
- const input = editor?.input;
180
- const disposable = fileMatch.onDispose(() => {
181
- input?.dispose();
182
- disposable.dispose();
183
- });
184
- await this.updateReplacePreview(fileMatch);
185
- if (editor) {
186
- const editorControl = editor.getControl();
187
- if (isSearchTreeMatch(element) && editorControl) {
188
- editorControl.revealLineInCenter(element.range().startLineNumber, ScrollType.Immediate);
189
- }
190
- }
191
- }
192
- async updateReplacePreview(fileMatch, override = false) {
193
- const replacePreviewUri = toReplaceResource(fileMatch.resource);
194
- const [sourceModelRef, replaceModelRef] = await Promise.all([
195
- this.textModelResolverService.createModelReference(fileMatch.resource),
196
- this.textModelResolverService.createModelReference(replacePreviewUri)
197
- ]);
198
- const sourceModel = sourceModelRef.object.textEditorModel;
199
- const replaceModel = replaceModelRef.object.textEditorModel;
200
- try {
201
- if (sourceModel && replaceModel) {
202
- if (override) {
203
- replaceModel.setValue(sourceModel.getValue());
204
- } else {
205
- replaceModel.undo();
206
- }
207
- this.applyEditsToPreview(fileMatch, replaceModel);
208
- }
209
- } finally {
210
- sourceModelRef.dispose();
211
- replaceModelRef.dispose();
212
- }
213
- }
214
- applyEditsToPreview(fileMatch, replaceModel) {
215
- const resourceEdits = this.createEdits(fileMatch, replaceModel.uri);
216
- const modelEdits = [];
217
- for (const resourceEdit of resourceEdits) {
218
- modelEdits.push(
219
- EditOperation.replaceMove(Range.lift(resourceEdit.textEdit.range), resourceEdit.textEdit.text)
220
- );
221
- }
222
- replaceModel.pushEditOperations(
223
- [],
224
- modelEdits.sort((a, b) => Range.compareRangesUsingStarts(a.range, b.range)),
225
- () => []
226
- );
227
- }
228
- createEdits(arg, resource = null) {
229
- const edits = [];
230
- if (isSearchTreeMatch(arg)) {
231
- if (!arg.isReadonly) {
232
- if (isIMatchInNotebook(arg)) {
233
- const match = arg;
234
- edits.push(this.createEdit(match, match.replaceString, match.cell?.uri));
235
- } else {
236
- const match = arg;
237
- edits.push(this.createEdit(match, match.replaceString, resource));
238
- }
239
- }
240
- }
241
- if (isSearchTreeFileMatch(arg)) {
242
- arg = [arg];
243
- }
244
- if (arg instanceof Array) {
245
- arg.forEach(element => {
246
- const fileMatch = element;
247
- if (fileMatch.count() > 0) {
248
- edits.push(...fileMatch.matches().flatMap(match => this.createEdits(match, resource)));
249
- }
250
- });
251
- }
252
- return edits;
253
- }
254
- createEdit(match, text, resource = null) {
255
- const fileMatch = match.parent();
256
- return ( new ResourceTextEdit(resource ?? fileMatch.resource, {
257
- range: match.range(),
258
- text
259
- }, undefined, undefined));
260
- }
261
- };
262
- ReplaceService = ReplaceService_1 = ( __decorate([( __param(0, ITextFileService)), ( __param(1, IEditorService)), ( __param(2, ITextModelService)), ( __param(3, IBulkEditService)), ( __param(4, ILabelService)), ( __param(5, INotebookEditorModelResolverService))], ReplaceService));
263
-
264
- export { ReplacePreviewContentProvider, ReplaceService };
@@ -1,148 +0,0 @@
1
-
2
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
3
- import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
4
- import { Extensions, ConfigurationScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
5
- import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
6
- import { registerContributions } from './replaceContributions.js';
7
- import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
8
- import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService';
9
- import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/common/searchHistoryService';
10
- import { searchConfigurationNode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/common/search';
11
- import { SearchSortOrder, DEFAULT_MAX_SEARCH_RESULTS, SEARCH_EXCLUDE_CONFIG } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/search/common/search';
12
-
13
- registerContributions();
14
- ( Registry.as(Extensions.Configuration)).registerConfiguration({
15
- ...searchConfigurationNode,
16
- properties: {
17
- [SEARCH_EXCLUDE_CONFIG]: {
18
- type: "object",
19
- markdownDescription: ( localize(
20
- 15889,
21
- "Configure [glob patterns](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options) for excluding files and folders in fulltext searches and file search in quick open. To exclude files from the recently opened list in quick open, patterns must be absolute (for example `**/node_modules/**`). Inherits all glob patterns from the `#files.exclude#` setting."
22
- )),
23
- default: {
24
- "**/node_modules": true,
25
- "**/bower_components": true,
26
- "**/*.code-search": true
27
- },
28
- additionalProperties: {
29
- anyOf: [{
30
- type: "boolean",
31
- description: ( localize(
32
- 15890,
33
- "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."
34
- ))
35
- }, {
36
- type: "object",
37
- properties: {
38
- when: {
39
- type: "string",
40
- pattern: "\\w*\\$\\(basename\\)\\w*",
41
- default: "$(basename).ext",
42
- markdownDescription: ( localize(
43
- 15891,
44
- "Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name."
45
- ))
46
- }
47
- }
48
- }]
49
- },
50
- scope: ConfigurationScope.RESOURCE
51
- },
52
- "search.useIgnoreFiles": {
53
- type: "boolean",
54
- markdownDescription: ( localize(
55
- 15892,
56
- "Controls whether to use `.gitignore` and `.ignore` files when searching for files."
57
- )),
58
- default: true,
59
- scope: ConfigurationScope.RESOURCE
60
- },
61
- "search.useGlobalIgnoreFiles": {
62
- type: "boolean",
63
- markdownDescription: ( localize(
64
- 15893,
65
- "Controls whether to use your global gitignore file (for example, from `$HOME/.config/git/ignore`) when searching for files. Requires {0} to be enabled.",
66
- "`#search.useIgnoreFiles#`"
67
- )),
68
- default: false,
69
- scope: ConfigurationScope.RESOURCE
70
- },
71
- "search.useParentIgnoreFiles": {
72
- type: "boolean",
73
- markdownDescription: ( localize(
74
- 15894,
75
- "Controls whether to use `.gitignore` and `.ignore` files in parent directories when searching for files. Requires {0} to be enabled.",
76
- "`#search.useIgnoreFiles#`"
77
- )),
78
- default: false,
79
- scope: ConfigurationScope.RESOURCE
80
- },
81
- "search.ripgrep.maxThreads": {
82
- type: "number",
83
- description: ( localize(
84
- 15895,
85
- "Number of threads to use for searching. When set to 0, the engine automatically determines this value."
86
- )),
87
- default: 0
88
- },
89
- "search.followSymlinks": {
90
- type: "boolean",
91
- description: ( localize(15896, "Controls whether to follow symlinks while searching.")),
92
- default: true
93
- },
94
- "search.smartCase": {
95
- type: "boolean",
96
- description: ( localize(
97
- 15897,
98
- "Search case-insensitively if the pattern is all lowercase, otherwise, search case-sensitively."
99
- )),
100
- default: false
101
- },
102
- "search.maxResults": {
103
- type: ["number", "null"],
104
- default: DEFAULT_MAX_SEARCH_RESULTS,
105
- markdownDescription: ( localize(
106
- 15898,
107
- "Controls the maximum number of search results, this can be set to `null` (empty) to return unlimited results."
108
- ))
109
- },
110
- "search.sortOrder": {
111
- type: "string",
112
- enum: [
113
- SearchSortOrder.Default,
114
- SearchSortOrder.FileNames,
115
- SearchSortOrder.Type,
116
- SearchSortOrder.Modified,
117
- SearchSortOrder.CountDescending,
118
- SearchSortOrder.CountAscending
119
- ],
120
- default: SearchSortOrder.Default,
121
- enumDescriptions: [( localize(
122
- 15899,
123
- "Results are sorted by folder and file names, in alphabetical order."
124
- )), ( localize(
125
- 15900,
126
- "Results are sorted by file names ignoring folder order, in alphabetical order."
127
- )), ( localize(15901, "Results are sorted by file extensions, in alphabetical order.")), ( localize(
128
- 15902,
129
- "Results are sorted by file last modified date, in descending order."
130
- )), ( localize(15903, "Results are sorted by count per file, in descending order.")), ( localize(15904, "Results are sorted by count per file, in ascending order."))],
131
- description: ( localize(15905, "Controls sorting order of search results."))
132
- },
133
- "search.searchOnType": {
134
- type: "boolean",
135
- default: true,
136
- description: ( localize(15906, "Search all files as you type."))
137
- },
138
- "search.searchOnTypeDebouncePeriod": {
139
- type: "number",
140
- default: 300,
141
- markdownDescription: ( localize(
142
- 15907,
143
- "When {0} is enabled, controls the timeout in milliseconds between a character being typed and the search starting. Has no effect when {0} is disabled.",
144
- "`#search.searchOnType#`"
145
- ))
146
- }
147
- }
148
- });
@@ -1,41 +0,0 @@
1
-
2
- import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
3
- import { SearchCommandIds } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/common/constants';
4
- import { registerAction2, Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
5
- import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
6
- import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
7
- import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
8
-
9
- registerAction2(class ShowAllSymbolsAction extends Action2 {
10
- static {
11
- this.ID = "workbench.action.showAllSymbols";
12
- }
13
- static {
14
- this.LABEL = ( localize(16036, "Go to Symbol in Workspace..."));
15
- }
16
- static {
17
- this.ALL_SYMBOLS_PREFIX = "#";
18
- }
19
- constructor() {
20
- super({
21
- id: SearchCommandIds.ShowAllSymbolsActionId,
22
- title: {
23
- ...( localize2(16036, "Go to Symbol in Workspace...")),
24
- mnemonicTitle: ( localize(16037, "Go to Symbol in &&Workspace..."))
25
- },
26
- f1: true,
27
- keybinding: {
28
- weight: KeybindingWeight.WorkbenchContrib,
29
- primary: KeyMod.CtrlCmd | KeyCode.KeyT
30
- },
31
- menu: {
32
- id: MenuId.MenubarGoMenu,
33
- group: "3_global_nav",
34
- order: 2
35
- }
36
- });
37
- }
38
- async run(accessor) {
39
- accessor.get(IQuickInputService).quickAccess.show(ShowAllSymbolsAction.ALL_SYMBOLS_PREFIX);
40
- }
41
- });
@@ -1,38 +0,0 @@
1
-
2
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
3
- import { AbstractGotoLineQuickAccessProvider } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess';
4
- import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickAccess';
5
- import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
6
- import { defaultQuickAccessContextKeyValue } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/quickaccess';
7
- import { GotoSymbolQuickAccessProvider } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess';
8
- import { AnythingQuickAccessProvider } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/anythingQuickAccess';
9
- import { SymbolsQuickAccessProvider } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/symbolsQuickAccess';
10
- import './searchActionsSymbol.js';
11
-
12
- const quickAccessRegistry = ( Registry.as(Extensions.Quickaccess));
13
- quickAccessRegistry.registerQuickAccessProvider({
14
- ctor: AnythingQuickAccessProvider,
15
- prefix: AnythingQuickAccessProvider.PREFIX,
16
- placeholder: ( localize(
17
- 16076,
18
- "Search files by name (append {0} to go to line or {1} to go to symbol)",
19
- AbstractGotoLineQuickAccessProvider.GO_TO_LINE_PREFIX,
20
- GotoSymbolQuickAccessProvider.PREFIX
21
- )),
22
- contextKey: defaultQuickAccessContextKeyValue,
23
- helpEntries: [{
24
- description: ( localize(16077, "Go to File")),
25
- commandId: "workbench.action.quickOpen",
26
- commandCenterOrder: 10
27
- }]
28
- });
29
- quickAccessRegistry.registerQuickAccessProvider({
30
- ctor: SymbolsQuickAccessProvider,
31
- prefix: SymbolsQuickAccessProvider.PREFIX,
32
- placeholder: ( localize(16078, "Type the name of a symbol to open.")),
33
- contextKey: "inWorkspaceSymbolsPicker",
34
- helpEntries: [{
35
- description: ( localize(16079, "Go to Symbol in Workspace")),
36
- commandId: "workbench.action.showAllSymbols"
37
- }]
38
- });