@codingame/monaco-vscode-search-service-override 4.5.0 → 4.5.2
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/index.d.ts +1 -1
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +82 -120
- package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +29 -40
- package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +21 -44
- package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +34 -35
- package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +132 -217
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +8 -19
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +46 -131
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +24 -42
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +4 -15
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +2 -5
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +52 -61
- package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +6 -13
- package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +22 -97
- package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +5 -9
- package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +53 -104
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +168 -282
- package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +52 -81
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +14 -25
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +38 -120
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +50 -79
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +30 -40
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +21 -42
- package/vscode/src/vs/workbench/services/search/browser/searchService.js +29 -36
- package/vscode/src/vs/workbench/services/search/common/searchService.js +3 -3
- package/search.d.ts +0 -12
package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js
CHANGED
|
@@ -26,6 +26,7 @@ import { PickerEditorState } from 'vscode/vscode/vs/workbench/browser/quickacces
|
|
|
26
26
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
27
27
|
import { Sequencer } from 'vscode/vscode/vs/base/common/async';
|
|
28
28
|
|
|
29
|
+
const _moduleId = "vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess";
|
|
29
30
|
const TEXT_SEARCH_QUICK_ACCESS_PREFIX = '%';
|
|
30
31
|
const DEFAULT_TEXT_QUERY_BUILDER_OPTIONS = {
|
|
31
32
|
_reason: 'quickAccessSearch',
|
|
@@ -68,14 +69,14 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
68
69
|
this.searchModel = this._register(this._instantiationService.createInstance(SearchModel));
|
|
69
70
|
this.editorViewState = this._register(this._instantiationService.createInstance(PickerEditorState));
|
|
70
71
|
this.searchModel.location = SearchModelLocation.QUICK_ACCESS;
|
|
71
|
-
this.editorSequencer = ( new Sequencer());
|
|
72
|
+
this.editorSequencer = ( (new Sequencer()));
|
|
72
73
|
}
|
|
73
74
|
dispose() {
|
|
74
75
|
this.searchModel.dispose();
|
|
75
76
|
super.dispose();
|
|
76
77
|
}
|
|
77
78
|
provide(picker, token, runOptions) {
|
|
78
|
-
const disposables = ( new DisposableStore());
|
|
79
|
+
const disposables = ( (new DisposableStore()));
|
|
79
80
|
if (TEXT_SEARCH_QUICK_ACCESS_PREFIX.length < picker.value.length) {
|
|
80
81
|
picker.valueSelection = [TEXT_SEARCH_QUICK_ACCESS_PREFIX.length, picker.value.length];
|
|
81
82
|
}
|
|
@@ -143,13 +144,13 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
143
144
|
};
|
|
144
145
|
this.searchModel.searchResult.toggleHighlights(false);
|
|
145
146
|
const charsPerLine = content.isRegExp ? 10000 : 1000;
|
|
146
|
-
const query = this.queryBuilder.text(content, ( folderResources.map(folder => folder.uri)), this._getTextQueryBuilderOptions(charsPerLine));
|
|
147
|
+
const query = this.queryBuilder.text(content, ( (folderResources.map(folder => folder.uri))), this._getTextQueryBuilderOptions(charsPerLine));
|
|
147
148
|
const result = this.searchModel.search(query, undefined, token);
|
|
148
149
|
const getAsyncResults = async () => {
|
|
149
150
|
this.currentAsyncSearch = result.asyncResults;
|
|
150
151
|
await result.asyncResults;
|
|
151
|
-
const syncResultURIs = ( new ResourceSet((
|
|
152
|
-
return this.searchModel.searchResult.matches().filter(e => !( syncResultURIs.has(e.resource)));
|
|
152
|
+
const syncResultURIs = ( (new ResourceSet( (result.syncResults.map(e => e.resource)))));
|
|
153
|
+
return this.searchModel.searchResult.matches().filter(e => !( (syncResultURIs.has(e.resource))));
|
|
153
154
|
};
|
|
154
155
|
return {
|
|
155
156
|
syncResults: this.searchModel.searchResult.matches(),
|
|
@@ -182,11 +183,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
182
183
|
type: 'separator',
|
|
183
184
|
});
|
|
184
185
|
picks.push({
|
|
185
|
-
label: ( localizeWithPath(
|
|
186
|
-
'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess',
|
|
187
|
-
'QuickSearchSeeMoreFiles',
|
|
188
|
-
"See More Files"
|
|
189
|
-
)),
|
|
186
|
+
label: ( localizeWithPath(_moduleId, 0, "See More Files")),
|
|
190
187
|
iconClass: ThemeIcon.asClassName(searchDetailsIcon),
|
|
191
188
|
accept: async () => {
|
|
192
189
|
this.moveToSearchViewlet(matches[limit]);
|
|
@@ -203,11 +200,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
203
200
|
description,
|
|
204
201
|
buttons: [{
|
|
205
202
|
iconClass: ThemeIcon.asClassName(searchOpenInFileIcon),
|
|
206
|
-
tooltip: ( localizeWithPath(
|
|
207
|
-
'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess',
|
|
208
|
-
'QuickSearchOpenInFile',
|
|
209
|
-
"Open File"
|
|
210
|
-
))
|
|
203
|
+
tooltip: ( localizeWithPath(_moduleId, 1, "Open File"))
|
|
211
204
|
}],
|
|
212
205
|
trigger: async () => {
|
|
213
206
|
await this.handleAccept(fileMatch, {});
|
|
@@ -219,11 +212,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
219
212
|
const element = results[matchIndex];
|
|
220
213
|
if (matchIndex === MAX_RESULTS_PER_FILE) {
|
|
221
214
|
picks.push({
|
|
222
|
-
label: ( localizeWithPath(
|
|
223
|
-
'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess',
|
|
224
|
-
'QuickSearchMore',
|
|
225
|
-
"More"
|
|
226
|
-
)),
|
|
215
|
+
label: ( localizeWithPath(_moduleId, 2, "More")),
|
|
227
216
|
iconClass: ThemeIcon.asClassName(searchDetailsIcon),
|
|
228
217
|
accept: async () => {
|
|
229
218
|
this.moveToSearchViewlet(element);
|
|
@@ -244,11 +233,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
244
233
|
},
|
|
245
234
|
buttons: [{
|
|
246
235
|
iconClass: ThemeIcon.asClassName(searchActivityBarIcon),
|
|
247
|
-
tooltip: ( localizeWithPath(
|
|
248
|
-
'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess',
|
|
249
|
-
'showMore',
|
|
250
|
-
"See in Search Panel"
|
|
251
|
-
)),
|
|
236
|
+
tooltip: ( localizeWithPath(_moduleId, 3, "See in Search Panel")),
|
|
252
237
|
}],
|
|
253
238
|
ariaLabel: `Match at location ${element.range().startLineNumber}:${element.range().startColumn} - ${previewText}`,
|
|
254
239
|
accept: async (keyMods, event) => {
|
|
@@ -286,14 +271,10 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
286
271
|
if (contentPattern === '') {
|
|
287
272
|
this.searchModel.searchResult.clear();
|
|
288
273
|
return [{
|
|
289
|
-
label: ( localizeWithPath(
|
|
290
|
-
'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess',
|
|
291
|
-
'enterSearchTerm',
|
|
292
|
-
"Enter a term to search for across your files."
|
|
293
|
-
))
|
|
274
|
+
label: ( localizeWithPath(_moduleId, 4, "Enter a term to search for across your files."))
|
|
294
275
|
}];
|
|
295
276
|
}
|
|
296
|
-
const conditionalTokenCts = disposables.add(( new CancellationTokenSource()));
|
|
277
|
+
const conditionalTokenCts = disposables.add(( (new CancellationTokenSource())));
|
|
297
278
|
disposables.add(token.onCancellationRequested(() => {
|
|
298
279
|
if (searchModelAtTimeOfSearch.location === SearchModelLocation.QUICK_ACCESS) {
|
|
299
280
|
conditionalTokenCts.cancel();
|
|
@@ -315,11 +296,7 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
315
296
|
picks: syncResult,
|
|
316
297
|
additionalPicks: allMatches.asyncResults
|
|
317
298
|
.then(asyncResults => (asyncResults.length + syncResult.length === 0) ? [{
|
|
318
|
-
label: ( localizeWithPath(
|
|
319
|
-
'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess',
|
|
320
|
-
'noAnythingResults',
|
|
321
|
-
"No matching results"
|
|
322
|
-
))
|
|
299
|
+
label: ( localizeWithPath(_moduleId, 5, "No matching results"))
|
|
323
300
|
}] : this._getPicksFromMatches(asyncResults, MAX_FILES_SHOWN - matches.length))
|
|
324
301
|
.then(picks => {
|
|
325
302
|
if (picks.length > 0) {
|
|
@@ -330,13 +307,13 @@ let TextSearchQuickAccess = class TextSearchQuickAccess extends PickerQuickAcces
|
|
|
330
307
|
};
|
|
331
308
|
}
|
|
332
309
|
};
|
|
333
|
-
TextSearchQuickAccess = ( __decorate([
|
|
334
|
-
( __param(0, IInstantiationService)),
|
|
335
|
-
( __param(1, IWorkspaceContextService)),
|
|
336
|
-
( __param(2, IEditorService)),
|
|
337
|
-
( __param(3, ILabelService)),
|
|
338
|
-
( __param(4, IViewsService)),
|
|
339
|
-
( __param(5, IConfigurationService))
|
|
340
|
-
], TextSearchQuickAccess));
|
|
310
|
+
TextSearchQuickAccess = ( (__decorate([
|
|
311
|
+
( (__param(0, IInstantiationService))),
|
|
312
|
+
( (__param(1, IWorkspaceContextService))),
|
|
313
|
+
( (__param(2, IEditorService))),
|
|
314
|
+
( (__param(3, ILabelService))),
|
|
315
|
+
( (__param(4, IViewsService))),
|
|
316
|
+
( (__param(5, IConfigurationService)))
|
|
317
|
+
], TextSearchQuickAccess)));
|
|
341
318
|
|
|
342
319
|
export { TEXT_SEARCH_QUICK_ACCESS_PREFIX, TextSearchQuickAccess };
|
|
@@ -23,6 +23,7 @@ import { CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/note
|
|
|
23
23
|
import { INotebookEditorModelResolverService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service';
|
|
24
24
|
|
|
25
25
|
var ReplaceService_1;
|
|
26
|
+
const _moduleId = "vs/workbench/contrib/search/browser/replaceService";
|
|
26
27
|
const REPLACE_PREVIEW = 'replacePreview';
|
|
27
28
|
const toReplaceResource = (fileResource) => {
|
|
28
29
|
return fileResource.with({ scheme: Schemas.internal, fragment: REPLACE_PREVIEW, query: JSON.stringify({ scheme: fileResource.scheme }) });
|
|
@@ -44,10 +45,10 @@ let ReplacePreviewContentProvider = class ReplacePreviewContentProvider {
|
|
|
44
45
|
return null;
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
ReplacePreviewContentProvider = ( __decorate([
|
|
48
|
-
( __param(0, IInstantiationService)),
|
|
49
|
-
( __param(1, ITextModelService))
|
|
50
|
-
], ReplacePreviewContentProvider));
|
|
48
|
+
ReplacePreviewContentProvider = ( (__decorate([
|
|
49
|
+
( (__param(0, IInstantiationService))),
|
|
50
|
+
( (__param(1, ITextModelService)))
|
|
51
|
+
], ReplacePreviewContentProvider)));
|
|
51
52
|
let ReplacePreviewModel = class ReplacePreviewModel extends Disposable {
|
|
52
53
|
constructor(modelService, languageService, textModelResolverService, replaceService, searchWorkbenchService) {
|
|
53
54
|
super();
|
|
@@ -59,7 +60,7 @@ let ReplacePreviewModel = class ReplacePreviewModel extends Disposable {
|
|
|
59
60
|
}
|
|
60
61
|
async resolve(replacePreviewUri) {
|
|
61
62
|
const fileResource = toFileResource(replacePreviewUri);
|
|
62
|
-
const fileMatch = this.searchWorkbenchService.searchModel.searchResult.matches().filter(match => ( match.resource.toString()) === ( fileResource.toString()))[0];
|
|
63
|
+
const fileMatch = this.searchWorkbenchService.searchModel.searchResult.matches().filter(match => ( (match.resource.toString())) === ( (fileResource.toString())))[0];
|
|
63
64
|
const ref = this._register(await this.textModelResolverService.createModelReference(fileResource));
|
|
64
65
|
const sourceModel = ref.object.textEditorModel;
|
|
65
66
|
const sourceModelLanguageId = sourceModel.getLanguageId();
|
|
@@ -77,20 +78,16 @@ let ReplacePreviewModel = class ReplacePreviewModel extends Disposable {
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
|
-
ReplacePreviewModel = ( __decorate([
|
|
81
|
-
( __param(0, IModelService)),
|
|
82
|
-
( __param(1, ILanguageService)),
|
|
83
|
-
( __param(2, ITextModelService)),
|
|
84
|
-
( __param(3, IReplaceService)),
|
|
85
|
-
( __param(4, ISearchViewModelWorkbenchService))
|
|
86
|
-
], ReplacePreviewModel));
|
|
81
|
+
ReplacePreviewModel = ( (__decorate([
|
|
82
|
+
( (__param(0, IModelService))),
|
|
83
|
+
( (__param(1, ILanguageService))),
|
|
84
|
+
( (__param(2, ITextModelService))),
|
|
85
|
+
( (__param(3, IReplaceService))),
|
|
86
|
+
( (__param(4, ISearchViewModelWorkbenchService)))
|
|
87
|
+
], ReplacePreviewModel)));
|
|
87
88
|
let ReplaceService = class ReplaceService {
|
|
88
89
|
static { ReplaceService_1 = this; }
|
|
89
|
-
static { this.REPLACE_SAVE_SOURCE = SaveSourceRegistry.registerSource('searchReplace.source', ( localizeWithPath(
|
|
90
|
-
'vs/workbench/contrib/search/browser/replaceService',
|
|
91
|
-
'searchReplace.source',
|
|
92
|
-
"Search and Replace"
|
|
93
|
-
))); }
|
|
90
|
+
static { this.REPLACE_SAVE_SOURCE = SaveSourceRegistry.registerSource('searchReplace.source', ( localizeWithPath(_moduleId, 0, "Search and Replace"))); }
|
|
94
91
|
constructor(textFileService, editorService, textModelResolverService, bulkEditorService, labelService, notebookEditorModelResolverService) {
|
|
95
92
|
this.textFileService = textFileService;
|
|
96
93
|
this.editorService = editorService;
|
|
@@ -102,7 +99,7 @@ let ReplaceService = class ReplaceService {
|
|
|
102
99
|
async replace(arg, progress = undefined, resource = null) {
|
|
103
100
|
const edits = this.createEdits(arg, resource);
|
|
104
101
|
await this.bulkEditorService.apply(edits, { progress });
|
|
105
|
-
const rawTextPromises = ( edits.map(async (e) => {
|
|
102
|
+
const rawTextPromises = ( (edits.map(async (e) => {
|
|
106
103
|
if (e.resource.scheme === Schemas.vscodeNotebookCell) {
|
|
107
104
|
const notebookResource = CellUri.parse(e.resource)?.notebook;
|
|
108
105
|
if (notebookResource) {
|
|
@@ -120,7 +117,7 @@ let ReplaceService = class ReplaceService {
|
|
|
120
117
|
else {
|
|
121
118
|
return this.textFileService.files.get(e.resource)?.save({ source: ReplaceService_1.REPLACE_SAVE_SOURCE });
|
|
122
119
|
}
|
|
123
|
-
}));
|
|
120
|
+
})));
|
|
124
121
|
return Promises.settled(rawTextPromises);
|
|
125
122
|
}
|
|
126
123
|
async openReplacePreview(element, preserveFocus, sideBySide, pinned) {
|
|
@@ -129,8 +126,8 @@ let ReplaceService = class ReplaceService {
|
|
|
129
126
|
original: { resource: fileMatch.resource },
|
|
130
127
|
modified: { resource: toReplaceResource(fileMatch.resource) },
|
|
131
128
|
label: ( localizeWithPath(
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
_moduleId,
|
|
130
|
+
1,
|
|
134
131
|
"{0} ↔ {1} (Replace Preview)",
|
|
135
132
|
fileMatch.name(),
|
|
136
133
|
fileMatch.name()
|
|
@@ -213,21 +210,23 @@ let ReplaceService = class ReplaceService {
|
|
|
213
210
|
}
|
|
214
211
|
createEdit(match, text, resource = null) {
|
|
215
212
|
const fileMatch = match.parent();
|
|
216
|
-
return (
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
213
|
+
return (
|
|
214
|
+
(new ResourceTextEdit(
|
|
215
|
+
resource ?? fileMatch.resource,
|
|
216
|
+
{ range: match.range(), text },
|
|
217
|
+
undefined,
|
|
218
|
+
undefined
|
|
219
|
+
))
|
|
220
|
+
);
|
|
222
221
|
}
|
|
223
222
|
};
|
|
224
|
-
ReplaceService = ReplaceService_1 = ( __decorate([
|
|
225
|
-
( __param(0, ITextFileService)),
|
|
226
|
-
( __param(1, IEditorService)),
|
|
227
|
-
( __param(2, ITextModelService)),
|
|
228
|
-
( __param(3, IBulkEditService)),
|
|
229
|
-
( __param(4, ILabelService)),
|
|
230
|
-
( __param(5, INotebookEditorModelResolverService))
|
|
231
|
-
], ReplaceService));
|
|
223
|
+
ReplaceService = ReplaceService_1 = ( (__decorate([
|
|
224
|
+
( (__param(0, ITextFileService))),
|
|
225
|
+
( (__param(1, IEditorService))),
|
|
226
|
+
( (__param(2, ITextModelService))),
|
|
227
|
+
( (__param(3, IBulkEditService))),
|
|
228
|
+
( (__param(4, ILabelService))),
|
|
229
|
+
( (__param(5, INotebookEditorModelResolverService)))
|
|
230
|
+
], ReplaceService)));
|
|
232
231
|
|
|
233
232
|
export { ReplacePreviewContentProvider, ReplaceService };
|