@codingame/monaco-vscode-search-service-override 4.5.1 → 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/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
|
@@ -30,6 +30,7 @@ import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/w
|
|
|
30
30
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
31
31
|
import { getActiveElement } from 'vscode/vscode/vs/base/browser/dom';
|
|
32
32
|
|
|
33
|
+
const _moduleId = "vs/workbench/contrib/searchEditor/browser/searchEditor.contribution";
|
|
33
34
|
const OpenInEditorCommandId = 'search.action.openInEditor';
|
|
34
35
|
const OpenNewEditorToSideCommandId = 'search.action.openNewEditorToSide';
|
|
35
36
|
const FocusQueryEditorWidgetCommandId = 'search.action.focusQueryEditorWidget';
|
|
@@ -43,23 +44,15 @@ const DecreaseSearchEditorContextLinesCommandId = 'decreaseSearchEditorContextLi
|
|
|
43
44
|
const RerunSearchEditorSearchCommandId = 'rerunSearchEditorSearch';
|
|
44
45
|
const CleanSearchEditorStateCommandId = 'cleanSearchEditorState';
|
|
45
46
|
const SelectAllSearchEditorMatchesCommandId = 'selectAllSearchEditorMatches';
|
|
46
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(SearchEditor, SearchEditor.ID, ( localizeWithPath(
|
|
47
|
-
|
|
48
|
-
'searchEditor',
|
|
49
|
-
"Search Editor"
|
|
50
|
-
))), [
|
|
51
|
-
( new SyncDescriptor(SearchEditorInput))
|
|
47
|
+
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(SearchEditor, SearchEditor.ID, ( localizeWithPath(_moduleId, 0, "Search Editor"))), [
|
|
48
|
+
( (new SyncDescriptor(SearchEditorInput)))
|
|
52
49
|
]);
|
|
53
50
|
let SearchEditorContribution = class SearchEditorContribution {
|
|
54
51
|
static { this.ID = 'workbench.contrib.searchEditor'; }
|
|
55
52
|
constructor(editorResolverService, instantiationService) {
|
|
56
53
|
editorResolverService.registerEditor('*' + SEARCH_EDITOR_EXT, {
|
|
57
54
|
id: SearchEditorInput.ID,
|
|
58
|
-
label: ( localizeWithPath(
|
|
59
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
60
|
-
'promptOpenWith.searchEditor.displayName',
|
|
61
|
-
"Search Editor"
|
|
62
|
-
)),
|
|
55
|
+
label: ( localizeWithPath(_moduleId, 1, "Search Editor")),
|
|
63
56
|
detail: DEFAULT_EDITOR_ASSOCIATION.providerDisplayName,
|
|
64
57
|
priority: RegisteredEditorPriority.default,
|
|
65
58
|
}, {
|
|
@@ -72,10 +65,10 @@ let SearchEditorContribution = class SearchEditorContribution {
|
|
|
72
65
|
});
|
|
73
66
|
}
|
|
74
67
|
};
|
|
75
|
-
SearchEditorContribution = ( __decorate([
|
|
76
|
-
( __param(0, IEditorResolverService)),
|
|
77
|
-
( __param(1, IInstantiationService))
|
|
78
|
-
], SearchEditorContribution));
|
|
68
|
+
SearchEditorContribution = ( (__decorate([
|
|
69
|
+
( (__param(0, IEditorResolverService))),
|
|
70
|
+
( (__param(1, IInstantiationService)))
|
|
71
|
+
], SearchEditorContribution)));
|
|
79
72
|
registerWorkbenchContribution2(SearchEditorContribution.ID, SearchEditorContribution, 1 );
|
|
80
73
|
class SearchEditorInputSerializer {
|
|
81
74
|
canSerialize(input) {
|
|
@@ -90,7 +83,7 @@ class SearchEditorInputSerializer {
|
|
|
90
83
|
}
|
|
91
84
|
let modelUri = undefined;
|
|
92
85
|
if (input.modelUri.path || input.modelUri.fragment && input.isDirty()) {
|
|
93
|
-
modelUri = ( input.modelUri.toString());
|
|
86
|
+
modelUri = ( (input.modelUri.toString()));
|
|
94
87
|
}
|
|
95
88
|
const config = input.tryReadConfigSync();
|
|
96
89
|
const dirty = input.isDirty();
|
|
@@ -102,14 +95,14 @@ class SearchEditorInputSerializer {
|
|
|
102
95
|
const { modelUri, dirty, config, matchRanges, backingUri } = JSON.parse(serializedEditorInput);
|
|
103
96
|
if (config && (config.query !== undefined)) {
|
|
104
97
|
if (modelUri) {
|
|
105
|
-
const input = instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'model', modelUri: ( URI.parse(modelUri)), config, backupOf: backingUri ? ( URI.parse(backingUri)) : undefined });
|
|
98
|
+
const input = instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'model', modelUri: ( (URI.parse(modelUri))), config, backupOf: backingUri ? ( (URI.parse(backingUri))) : undefined });
|
|
106
99
|
input.setDirty(dirty);
|
|
107
100
|
input.setMatchRanges(matchRanges);
|
|
108
101
|
return input;
|
|
109
102
|
}
|
|
110
103
|
else {
|
|
111
104
|
if (backingUri) {
|
|
112
|
-
return instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'existingFile', fileUri: ( URI.parse(backingUri)) });
|
|
105
|
+
return instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'existingFile', fileUri: ( (URI.parse(backingUri))) });
|
|
113
106
|
}
|
|
114
107
|
else {
|
|
115
108
|
return instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'rawData', resultsContents: '', config });
|
|
@@ -119,18 +112,14 @@ class SearchEditorInputSerializer {
|
|
|
119
112
|
return undefined;
|
|
120
113
|
}
|
|
121
114
|
}
|
|
122
|
-
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(SearchEditorInput.ID, SearchEditorInputSerializer);
|
|
115
|
+
( (Registry.as(EditorExtensions.EditorFactory))).registerEditorSerializer(SearchEditorInput.ID, SearchEditorInputSerializer);
|
|
123
116
|
CommandsRegistry.registerCommand(CleanSearchEditorStateCommandId, (accessor) => {
|
|
124
117
|
const activeEditorPane = accessor.get(IEditorService).activeEditorPane;
|
|
125
118
|
if (activeEditorPane instanceof SearchEditor) {
|
|
126
119
|
activeEditorPane.cleanState();
|
|
127
120
|
}
|
|
128
121
|
});
|
|
129
|
-
const category = ( localize2WithPath(
|
|
130
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
131
|
-
'search',
|
|
132
|
-
'Search Editor'
|
|
133
|
-
));
|
|
122
|
+
const category = ( localize2WithPath(_moduleId, 2, 'Search Editor'));
|
|
134
123
|
const translateLegacyConfig = (legacyConfig = {}) => {
|
|
135
124
|
const config = {};
|
|
136
125
|
const overrides = {
|
|
@@ -172,11 +161,7 @@ registerAction2(class extends Action2 {
|
|
|
172
161
|
constructor() {
|
|
173
162
|
super({
|
|
174
163
|
id: 'search.searchEditor.action.deleteFileResults',
|
|
175
|
-
title: ( localize2WithPath(
|
|
176
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
177
|
-
'searchEditor.deleteResultBlock',
|
|
178
|
-
'Delete File Results'
|
|
179
|
-
)),
|
|
164
|
+
title: ( localize2WithPath(_moduleId, 3, 'Delete File Results')),
|
|
180
165
|
keybinding: {
|
|
181
166
|
weight: 100 ,
|
|
182
167
|
primary: 2048 | 1024 | 1 ,
|
|
@@ -197,11 +182,7 @@ registerAction2(class extends Action2 {
|
|
|
197
182
|
constructor() {
|
|
198
183
|
super({
|
|
199
184
|
id: OpenNewEditorCommandId,
|
|
200
|
-
title: ( localize2WithPath(
|
|
201
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
202
|
-
'search.openNewSearchEditor',
|
|
203
|
-
'New Search Editor'
|
|
204
|
-
)),
|
|
185
|
+
title: ( localize2WithPath(_moduleId, 4, 'New Search Editor')),
|
|
205
186
|
category,
|
|
206
187
|
f1: true,
|
|
207
188
|
metadata: openArgMetadata
|
|
@@ -215,11 +196,7 @@ registerAction2(class extends Action2 {
|
|
|
215
196
|
constructor() {
|
|
216
197
|
super({
|
|
217
198
|
id: OpenEditorCommandId,
|
|
218
|
-
title: ( localize2WithPath(
|
|
219
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
220
|
-
'search.openSearchEditor',
|
|
221
|
-
'Open Search Editor'
|
|
222
|
-
)),
|
|
199
|
+
title: ( localize2WithPath(_moduleId, 5, 'Open Search Editor')),
|
|
223
200
|
category,
|
|
224
201
|
f1: true,
|
|
225
202
|
metadata: openArgMetadata
|
|
@@ -233,11 +210,7 @@ registerAction2(class extends Action2 {
|
|
|
233
210
|
constructor() {
|
|
234
211
|
super({
|
|
235
212
|
id: OpenNewEditorToSideCommandId,
|
|
236
|
-
title: ( localize2WithPath(
|
|
237
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
238
|
-
'search.openNewEditorToSide',
|
|
239
|
-
'Open New Search Editor to the Side'
|
|
240
|
-
)),
|
|
213
|
+
title: ( localize2WithPath(_moduleId, 6, 'Open New Search Editor to the Side')),
|
|
241
214
|
category,
|
|
242
215
|
f1: true,
|
|
243
216
|
metadata: openArgMetadata
|
|
@@ -251,19 +224,12 @@ registerAction2(class extends Action2 {
|
|
|
251
224
|
constructor() {
|
|
252
225
|
super({
|
|
253
226
|
id: OpenInEditorCommandId,
|
|
254
|
-
title: ( localize2WithPath(
|
|
255
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
256
|
-
'search.openResultsInEditor',
|
|
257
|
-
'Open Results in Editor'
|
|
258
|
-
)),
|
|
227
|
+
title: ( localize2WithPath(_moduleId, 7, 'Open Results in Editor')),
|
|
259
228
|
category,
|
|
260
229
|
f1: true,
|
|
261
230
|
keybinding: {
|
|
262
231
|
primary: 512 | 3 ,
|
|
263
|
-
when: ( ContextKeyExpr.and(
|
|
264
|
-
SearchContext.HasSearchResults,
|
|
265
|
-
SearchContext.SearchViewFocusedKey
|
|
266
|
-
)),
|
|
232
|
+
when: ( (ContextKeyExpr.and(SearchContext.HasSearchResults, SearchContext.SearchViewFocusedKey))),
|
|
267
233
|
weight: 200 ,
|
|
268
234
|
mac: {
|
|
269
235
|
primary: 2048 | 3
|
|
@@ -284,11 +250,7 @@ registerAction2(class extends Action2 {
|
|
|
284
250
|
constructor() {
|
|
285
251
|
super({
|
|
286
252
|
id: RerunSearchEditorSearchCommandId,
|
|
287
|
-
title: ( localize2WithPath(
|
|
288
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
289
|
-
'search.rerunSearchInEditor',
|
|
290
|
-
'Search Again'
|
|
291
|
-
)),
|
|
253
|
+
title: ( localize2WithPath(_moduleId, 8, 'Search Again')),
|
|
292
254
|
category,
|
|
293
255
|
keybinding: {
|
|
294
256
|
primary: 2048 | 1024 | 48 ,
|
|
@@ -299,11 +261,11 @@ registerAction2(class extends Action2 {
|
|
|
299
261
|
menu: [{
|
|
300
262
|
id: MenuId.EditorTitle,
|
|
301
263
|
group: 'navigation',
|
|
302
|
-
when: ( ActiveEditorContext.isEqualTo(SearchEditorID))
|
|
264
|
+
when: ( (ActiveEditorContext.isEqualTo(SearchEditorID)))
|
|
303
265
|
},
|
|
304
266
|
{
|
|
305
267
|
id: MenuId.CommandPalette,
|
|
306
|
-
when: ( ActiveEditorContext.isEqualTo(SearchEditorID))
|
|
268
|
+
when: ( (ActiveEditorContext.isEqualTo(SearchEditorID)))
|
|
307
269
|
}]
|
|
308
270
|
});
|
|
309
271
|
}
|
|
@@ -319,11 +281,7 @@ registerAction2(class extends Action2 {
|
|
|
319
281
|
constructor() {
|
|
320
282
|
super({
|
|
321
283
|
id: FocusQueryEditorWidgetCommandId,
|
|
322
|
-
title: ( localize2WithPath(
|
|
323
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
324
|
-
'search.action.focusQueryEditorWidget',
|
|
325
|
-
'Focus Search Editor Input'
|
|
326
|
-
)),
|
|
284
|
+
title: ( localize2WithPath(_moduleId, 9, 'Focus Search Editor Input')),
|
|
327
285
|
category,
|
|
328
286
|
f1: true,
|
|
329
287
|
precondition: InSearchEditor,
|
|
@@ -345,11 +303,7 @@ registerAction2(class extends Action2 {
|
|
|
345
303
|
constructor() {
|
|
346
304
|
super({
|
|
347
305
|
id: FocusQueryEditorFilesToIncludeCommandId,
|
|
348
|
-
title: ( localize2WithPath(
|
|
349
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
350
|
-
'search.action.focusFilesToInclude',
|
|
351
|
-
'Focus Search Editor Files to Include'
|
|
352
|
-
)),
|
|
306
|
+
title: ( localize2WithPath(_moduleId, 10, 'Focus Search Editor Files to Include')),
|
|
353
307
|
category,
|
|
354
308
|
f1: true,
|
|
355
309
|
precondition: InSearchEditor,
|
|
@@ -367,11 +321,7 @@ registerAction2(class extends Action2 {
|
|
|
367
321
|
constructor() {
|
|
368
322
|
super({
|
|
369
323
|
id: FocusQueryEditorFilesToExcludeCommandId,
|
|
370
|
-
title: ( localize2WithPath(
|
|
371
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
372
|
-
'search.action.focusFilesToExclude',
|
|
373
|
-
'Focus Search Editor Files to Exclude'
|
|
374
|
-
)),
|
|
324
|
+
title: ( localize2WithPath(_moduleId, 11, 'Focus Search Editor Files to Exclude')),
|
|
375
325
|
category,
|
|
376
326
|
f1: true,
|
|
377
327
|
precondition: InSearchEditor,
|
|
@@ -389,11 +339,7 @@ registerAction2(class extends Action2 {
|
|
|
389
339
|
constructor() {
|
|
390
340
|
super({
|
|
391
341
|
id: ToggleSearchEditorCaseSensitiveCommandId,
|
|
392
|
-
title: ( localize2WithPath(
|
|
393
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
394
|
-
'searchEditor.action.toggleSearchEditorCaseSensitive',
|
|
395
|
-
'Toggle Match Case'
|
|
396
|
-
)),
|
|
342
|
+
title: ( localize2WithPath(_moduleId, 12, 'Toggle Match Case')),
|
|
397
343
|
category,
|
|
398
344
|
f1: true,
|
|
399
345
|
precondition: InSearchEditor,
|
|
@@ -411,11 +357,7 @@ registerAction2(class extends Action2 {
|
|
|
411
357
|
constructor() {
|
|
412
358
|
super({
|
|
413
359
|
id: ToggleSearchEditorWholeWordCommandId,
|
|
414
|
-
title: ( localize2WithPath(
|
|
415
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
416
|
-
'searchEditor.action.toggleSearchEditorWholeWord',
|
|
417
|
-
'Toggle Match Whole Word'
|
|
418
|
-
)),
|
|
360
|
+
title: ( localize2WithPath(_moduleId, 13, 'Toggle Match Whole Word')),
|
|
419
361
|
category,
|
|
420
362
|
f1: true,
|
|
421
363
|
precondition: InSearchEditor,
|
|
@@ -433,11 +375,7 @@ registerAction2(class extends Action2 {
|
|
|
433
375
|
constructor() {
|
|
434
376
|
super({
|
|
435
377
|
id: ToggleSearchEditorRegexCommandId,
|
|
436
|
-
title: ( localize2WithPath(
|
|
437
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
438
|
-
'searchEditor.action.toggleSearchEditorRegex',
|
|
439
|
-
"Toggle Use Regular Expression"
|
|
440
|
-
)),
|
|
378
|
+
title: ( localize2WithPath(_moduleId, 14, "Toggle Use Regular Expression")),
|
|
441
379
|
category,
|
|
442
380
|
f1: true,
|
|
443
381
|
precondition: InSearchEditor,
|
|
@@ -455,11 +393,7 @@ registerAction2(class extends Action2 {
|
|
|
455
393
|
constructor() {
|
|
456
394
|
super({
|
|
457
395
|
id: ToggleSearchEditorContextLinesCommandId,
|
|
458
|
-
title: ( localize2WithPath(
|
|
459
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
460
|
-
'searchEditor.action.toggleSearchEditorContextLines',
|
|
461
|
-
"Toggle Context Lines"
|
|
462
|
-
)),
|
|
396
|
+
title: ( localize2WithPath(_moduleId, 15, "Toggle Context Lines")),
|
|
463
397
|
category,
|
|
464
398
|
f1: true,
|
|
465
399
|
precondition: InSearchEditor,
|
|
@@ -478,11 +412,7 @@ registerAction2(class extends Action2 {
|
|
|
478
412
|
constructor() {
|
|
479
413
|
super({
|
|
480
414
|
id: IncreaseSearchEditorContextLinesCommandId,
|
|
481
|
-
title: ( localize2WithPath(
|
|
482
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
483
|
-
'searchEditor.action.increaseSearchEditorContextLines',
|
|
484
|
-
"Increase Context Lines"
|
|
485
|
-
)),
|
|
415
|
+
title: ( localize2WithPath(_moduleId, 16, "Increase Context Lines")),
|
|
486
416
|
category,
|
|
487
417
|
f1: true,
|
|
488
418
|
precondition: InSearchEditor,
|
|
@@ -498,11 +428,7 @@ registerAction2(class extends Action2 {
|
|
|
498
428
|
constructor() {
|
|
499
429
|
super({
|
|
500
430
|
id: DecreaseSearchEditorContextLinesCommandId,
|
|
501
|
-
title: ( localize2WithPath(
|
|
502
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
503
|
-
'searchEditor.action.decreaseSearchEditorContextLines',
|
|
504
|
-
"Decrease Context Lines"
|
|
505
|
-
)),
|
|
431
|
+
title: ( localize2WithPath(_moduleId, 17, "Decrease Context Lines")),
|
|
506
432
|
category,
|
|
507
433
|
f1: true,
|
|
508
434
|
precondition: InSearchEditor,
|
|
@@ -518,11 +444,7 @@ registerAction2(class extends Action2 {
|
|
|
518
444
|
constructor() {
|
|
519
445
|
super({
|
|
520
446
|
id: SelectAllSearchEditorMatchesCommandId,
|
|
521
|
-
title: ( localize2WithPath(
|
|
522
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
523
|
-
'searchEditor.action.selectAllSearchEditorMatches',
|
|
524
|
-
"Select All Matches"
|
|
525
|
-
)),
|
|
447
|
+
title: ( localize2WithPath(_moduleId, 18, "Select All Matches")),
|
|
526
448
|
category,
|
|
527
449
|
f1: true,
|
|
528
450
|
precondition: InSearchEditor,
|
|
@@ -540,18 +462,14 @@ registerAction2(class OpenSearchEditorAction extends Action2 {
|
|
|
540
462
|
constructor() {
|
|
541
463
|
super({
|
|
542
464
|
id: 'search.action.openNewEditorFromView',
|
|
543
|
-
title: ( localizeWithPath(
|
|
544
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
|
|
545
|
-
'search.openNewEditor',
|
|
546
|
-
"Open New Search Editor"
|
|
547
|
-
)),
|
|
465
|
+
title: ( localizeWithPath(_moduleId, 19, "Open New Search Editor")),
|
|
548
466
|
category,
|
|
549
467
|
icon: searchNewEditorIcon,
|
|
550
468
|
menu: [{
|
|
551
469
|
id: MenuId.ViewTitle,
|
|
552
470
|
group: 'navigation',
|
|
553
471
|
order: 2,
|
|
554
|
-
when: ( ContextKeyExpr.equals('view', VIEW_ID)),
|
|
472
|
+
when: ( (ContextKeyExpr.equals('view', VIEW_ID))),
|
|
555
473
|
}]
|
|
556
474
|
});
|
|
557
475
|
}
|
|
@@ -581,8 +499,8 @@ let SearchEditorWorkingCopyEditorHandler = class SearchEditorWorkingCopyEditorHa
|
|
|
581
499
|
return input;
|
|
582
500
|
}
|
|
583
501
|
};
|
|
584
|
-
SearchEditorWorkingCopyEditorHandler = ( __decorate([
|
|
585
|
-
( __param(0, IInstantiationService)),
|
|
586
|
-
( __param(1, IWorkingCopyEditorService))
|
|
587
|
-
], SearchEditorWorkingCopyEditorHandler));
|
|
502
|
+
SearchEditorWorkingCopyEditorHandler = ( (__decorate([
|
|
503
|
+
( (__param(0, IInstantiationService))),
|
|
504
|
+
( (__param(1, IWorkingCopyEditorService)))
|
|
505
|
+
], SearchEditorWorkingCopyEditorHandler)));
|
|
588
506
|
registerWorkbenchContribution2(SearchEditorWorkingCopyEditorHandler.ID, SearchEditorWorkingCopyEditorHandler, 2 );
|
|
@@ -62,6 +62,7 @@ import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatab
|
|
|
62
62
|
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
63
63
|
|
|
64
64
|
var SearchEditor_1;
|
|
65
|
+
const _moduleId = "vs/workbench/contrib/searchEditor/browser/searchEditor";
|
|
65
66
|
const RESULT_LINE_REGEX = /^(\s+)(\d+)(: | )(\s*)(.*)$/;
|
|
66
67
|
const FILE_LINE_REGEX = /^(\S.*):$/;
|
|
67
68
|
let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
@@ -80,15 +81,15 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
80
81
|
this.notificationService = notificationService;
|
|
81
82
|
this.configurationService = configurationService;
|
|
82
83
|
this.logService = logService;
|
|
83
|
-
this.runSearchDelayer = ( new Delayer(0));
|
|
84
|
+
this.runSearchDelayer = ( (new Delayer(0)));
|
|
84
85
|
this.pauseSearching = false;
|
|
85
86
|
this.showingIncludesExcludes = false;
|
|
86
87
|
this.ongoingOperations = 0;
|
|
87
88
|
this.updatingModelForSearch = false;
|
|
88
89
|
this.container = $('.search-editor');
|
|
89
|
-
this.searchOperation = this._register(( new LongRunningOperation(progressService)));
|
|
90
|
-
this._register(this.messageDisposables = ( new DisposableStore()));
|
|
91
|
-
this.searchHistoryDelayer = ( new Delayer(2000));
|
|
90
|
+
this.searchOperation = this._register(( (new LongRunningOperation(progressService))));
|
|
91
|
+
this._register(this.messageDisposables = ( (new DisposableStore())));
|
|
92
|
+
this.searchHistoryDelayer = ( (new Delayer(2000)));
|
|
92
93
|
this.searchModel = this._register(this.instantiationService.createInstance(SearchModel));
|
|
93
94
|
}
|
|
94
95
|
createEditor(parent) {
|
|
@@ -99,7 +100,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
99
100
|
this.registerEditorListeners();
|
|
100
101
|
const scopedContextKeyService = assertIsDefined(this.scopedContextKeyService);
|
|
101
102
|
InSearchEditor.bindTo(scopedContextKeyService).set(true);
|
|
102
|
-
this.createQueryEditor(this.queryEditorContainer, this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, scopedContextKeyService]))), SearchContext.InputBoxFocusedKey.bindTo(scopedContextKeyService));
|
|
103
|
+
this.createQueryEditor(this.queryEditorContainer, this.instantiationService.createChild(( (new ServiceCollection([IContextKeyService, scopedContextKeyService])))), SearchContext.InputBoxFocusedKey.bindTo(scopedContextKeyService));
|
|
103
104
|
}
|
|
104
105
|
createQueryEditor(container, scopedInstantiationService, inputBoxFocusedContextKey) {
|
|
105
106
|
const searchEditorInputboxStyles = getInputBoxStyle({ inputBorder: searchEditorTextInputBorder });
|
|
@@ -116,24 +117,20 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
116
117
|
this._register(this.queryEditorWidget.onDidToggleContext(() => this.triggerSearch({ resetCursor: false })));
|
|
117
118
|
this.includesExcludesContainer = append(container, $('.includes-excludes'));
|
|
118
119
|
this.toggleQueryDetailsButton = append(this.includesExcludesContainer, $('.expand' + ThemeIcon.asCSSSelector(searchDetailsIcon), { tabindex: 0, role: 'button' }));
|
|
119
|
-
this._register(setupCustomHover(getDefaultHoverDelegate('element'), this.toggleQueryDetailsButton, ( localizeWithPath(
|
|
120
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor',
|
|
121
|
-
'moreSearch',
|
|
122
|
-
"Toggle Search Details"
|
|
123
|
-
))));
|
|
120
|
+
this._register(setupCustomHover(getDefaultHoverDelegate('element'), this.toggleQueryDetailsButton, ( localizeWithPath(_moduleId, 0, "Toggle Search Details"))));
|
|
124
121
|
this._register(addDisposableListener(this.toggleQueryDetailsButton, EventType.CLICK, e => {
|
|
125
122
|
EventHelper.stop(e);
|
|
126
123
|
this.toggleIncludesExcludes();
|
|
127
124
|
}));
|
|
128
125
|
this._register(addDisposableListener(this.toggleQueryDetailsButton, EventType.KEY_UP, (e) => {
|
|
129
|
-
const event = ( new StandardKeyboardEvent(e));
|
|
126
|
+
const event = ( (new StandardKeyboardEvent(e)));
|
|
130
127
|
if (event.equals(3 ) || event.equals(10 )) {
|
|
131
128
|
EventHelper.stop(e);
|
|
132
129
|
this.toggleIncludesExcludes();
|
|
133
130
|
}
|
|
134
131
|
}));
|
|
135
132
|
this._register(addDisposableListener(this.toggleQueryDetailsButton, EventType.KEY_DOWN, (e) => {
|
|
136
|
-
const event = ( new StandardKeyboardEvent(e));
|
|
133
|
+
const event = ( (new StandardKeyboardEvent(e)));
|
|
137
134
|
if (event.equals(1024 | 2 )) {
|
|
138
135
|
if (this.queryEditorWidget.isReplaceActive()) {
|
|
139
136
|
this.queryEditorWidget.focusReplaceAllAction();
|
|
@@ -145,35 +142,19 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
145
142
|
}
|
|
146
143
|
}));
|
|
147
144
|
const folderIncludesList = append(this.includesExcludesContainer, $('.file-types.includes'));
|
|
148
|
-
const filesToIncludeTitle = ( localizeWithPath(
|
|
149
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor',
|
|
150
|
-
'searchScope.includes',
|
|
151
|
-
"files to include"
|
|
152
|
-
));
|
|
145
|
+
const filesToIncludeTitle = ( localizeWithPath(_moduleId, 1, "files to include"));
|
|
153
146
|
append(folderIncludesList, $('h4', undefined, filesToIncludeTitle));
|
|
154
147
|
this.inputPatternIncludes = this._register(scopedInstantiationService.createInstance(IncludePatternInputWidget, folderIncludesList, this.contextViewService, {
|
|
155
|
-
ariaLabel: ( localizeWithPath(
|
|
156
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor',
|
|
157
|
-
'label.includes',
|
|
158
|
-
'Search Include Patterns'
|
|
159
|
-
)),
|
|
148
|
+
ariaLabel: ( localizeWithPath(_moduleId, 2, 'Search Include Patterns')),
|
|
160
149
|
inputBoxStyles: searchEditorInputboxStyles
|
|
161
150
|
}));
|
|
162
151
|
this.inputPatternIncludes.onSubmit(triggeredOnType => this.triggerSearch({ resetCursor: false, delay: triggeredOnType ? this.searchConfig.searchOnTypeDebouncePeriod : 0 }));
|
|
163
152
|
this._register(this.inputPatternIncludes.onChangeSearchInEditorsBox(() => this.triggerSearch()));
|
|
164
153
|
const excludesList = append(this.includesExcludesContainer, $('.file-types.excludes'));
|
|
165
|
-
const excludesTitle = ( localizeWithPath(
|
|
166
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor',
|
|
167
|
-
'searchScope.excludes',
|
|
168
|
-
"files to exclude"
|
|
169
|
-
));
|
|
154
|
+
const excludesTitle = ( localizeWithPath(_moduleId, 3, "files to exclude"));
|
|
170
155
|
append(excludesList, $('h4', undefined, excludesTitle));
|
|
171
156
|
this.inputPatternExcludes = this._register(scopedInstantiationService.createInstance(ExcludePatternInputWidget, excludesList, this.contextViewService, {
|
|
172
|
-
ariaLabel: ( localizeWithPath(
|
|
173
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor',
|
|
174
|
-
'label.excludes',
|
|
175
|
-
'Search Exclude Patterns'
|
|
176
|
-
)),
|
|
157
|
+
ariaLabel: ( localizeWithPath(_moduleId, 4, 'Search Exclude Patterns')),
|
|
177
158
|
inputBoxStyles: searchEditorInputboxStyles
|
|
178
159
|
}));
|
|
179
160
|
this.inputPatternExcludes.onSubmit(triggeredOnType => this.triggerSearch({ resetCursor: false, delay: triggeredOnType ? this.searchConfig.searchOnTypeDebouncePeriod : 0 }));
|
|
@@ -192,11 +173,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
192
173
|
clearNode(this.messageBox);
|
|
193
174
|
this.messageDisposables.clear();
|
|
194
175
|
if (show) {
|
|
195
|
-
const runAgainLink = append(this.messageBox, $('a.pointer.prominent.message', {}, ( localizeWithPath(
|
|
196
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor',
|
|
197
|
-
'runSearch',
|
|
198
|
-
"Run Search"
|
|
199
|
-
))));
|
|
176
|
+
const runAgainLink = append(this.messageBox, $('a.pointer.prominent.message', {}, ( localizeWithPath(_moduleId, 5, "Run Search"))));
|
|
200
177
|
this.messageDisposables.add(addDisposableListener(runAgainLink, EventType.CLICK, async () => {
|
|
201
178
|
await this.triggerSearch();
|
|
202
179
|
this.searchResultEditor.focus();
|
|
@@ -330,7 +307,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
330
307
|
this.toggleIncludesExcludes(shouldShow);
|
|
331
308
|
}
|
|
332
309
|
deleteResultBlock() {
|
|
333
|
-
const linesToDelete = ( new Set());
|
|
310
|
+
const linesToDelete = ( (new Set()));
|
|
334
311
|
const selections = this.searchResultEditor.getSelections();
|
|
335
312
|
const model = this.searchResultEditor.getModel();
|
|
336
313
|
if (!(selections && model)) {
|
|
@@ -371,7 +348,9 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
371
348
|
endingCursorLines.push(1);
|
|
372
349
|
}
|
|
373
350
|
const isDefined = (x) => x !== undefined;
|
|
374
|
-
model.pushEditOperations(this.searchResultEditor.getSelections(), ( [...linesToDelete].map(
|
|
351
|
+
model.pushEditOperations(this.searchResultEditor.getSelections(), ( ([...linesToDelete].map(
|
|
352
|
+
line => ({ range: ( (new Range(line, 1, line + 1, 1))), text: '' })
|
|
353
|
+
))), () => ( (endingCursorLines.filter(isDefined).map(line => ( (new Selection(line, 1, line, 1)))))));
|
|
375
354
|
}
|
|
376
355
|
cleanState() {
|
|
377
356
|
this.getInput()?.setDirty(false);
|
|
@@ -386,7 +365,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
386
365
|
}
|
|
387
366
|
const lastLine = model.getLineCount() ?? 1;
|
|
388
367
|
const lastColumn = model.getLineLength(lastLine);
|
|
389
|
-
const fallbackStart = reverse ? ( new Position(lastLine, lastColumn)) : ( new Position(1, 1));
|
|
368
|
+
const fallbackStart = reverse ? ( (new Position(lastLine, lastColumn))) : ( (new Position(1, 1)));
|
|
390
369
|
const currentPosition = this.searchResultEditor.getSelection()?.getStartPosition() ?? fallbackStart;
|
|
391
370
|
const matchRanges = this.getInput()?.getMatchRanges();
|
|
392
371
|
if (!matchRanges) {
|
|
@@ -400,15 +379,15 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
400
379
|
const matchText = model.getValueInRange(matchRange);
|
|
401
380
|
let file = '';
|
|
402
381
|
for (let line = matchRange.startLineNumber; line >= 1; line--) {
|
|
403
|
-
const lineText = model.getValueInRange(( new Range(line, 1, line, 2)));
|
|
382
|
+
const lineText = model.getValueInRange(( (new Range(line, 1, line, 2))));
|
|
404
383
|
if (lineText !== ' ') {
|
|
405
384
|
file = model.getLineContent(line);
|
|
406
385
|
break;
|
|
407
386
|
}
|
|
408
387
|
}
|
|
409
388
|
alert(( localizeWithPath(
|
|
410
|
-
|
|
411
|
-
|
|
389
|
+
_moduleId,
|
|
390
|
+
6,
|
|
412
391
|
"Matched {0} at {1} in file {2}",
|
|
413
392
|
matchText,
|
|
414
393
|
matchLineText,
|
|
@@ -423,12 +402,12 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
423
402
|
}
|
|
424
403
|
focusAllResults() {
|
|
425
404
|
this.searchResultEditor
|
|
426
|
-
.setSelections(( (this.getInput()?.getMatchRanges() ?? []).map(range => ( new Selection(
|
|
405
|
+
.setSelections(( ((this.getInput()?.getMatchRanges() ?? []).map(range => ( (new Selection(
|
|
427
406
|
range.startLineNumber,
|
|
428
407
|
range.startColumn,
|
|
429
408
|
range.endLineNumber,
|
|
430
409
|
range.endColumn
|
|
431
|
-
)))));
|
|
410
|
+
)))))));
|
|
432
411
|
this.searchResultEditor.focus();
|
|
433
412
|
}
|
|
434
413
|
async triggerSearch(_options) {
|
|
@@ -438,7 +417,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
438
417
|
this.toggleRunAgainMessage(false);
|
|
439
418
|
await this.doRunSearch();
|
|
440
419
|
if (options.resetCursor) {
|
|
441
|
-
this.searchResultEditor.setPosition(( new Position(1, 1)));
|
|
420
|
+
this.searchResultEditor.setPosition(( (new Position(1, 1))));
|
|
442
421
|
this.searchResultEditor.setScrollPosition({ scrollTop: 0, scrollLeft: 0 });
|
|
443
422
|
}
|
|
444
423
|
if (options.focusResults) {
|
|
@@ -516,7 +495,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
516
495
|
let query;
|
|
517
496
|
try {
|
|
518
497
|
const queryBuilder = this.instantiationService.createInstance(QueryBuilder);
|
|
519
|
-
query = queryBuilder.text(content, ( folderResources.map(folder => folder.uri)), options);
|
|
498
|
+
query = queryBuilder.text(content, ( (folderResources.map(folder => folder.uri))), options);
|
|
520
499
|
}
|
|
521
500
|
catch (err) {
|
|
522
501
|
return;
|
|
@@ -575,7 +554,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
575
554
|
append(messageBox, renderSearchMessage(message, this.instantiationService, this.notificationService, this.openerService, this.commandService, this.messageDisposables, () => this.triggerSearch()));
|
|
576
555
|
}
|
|
577
556
|
async retrieveFileStats(searchResult) {
|
|
578
|
-
const files = ( searchResult.matches().filter(f => !f.fileStat).map(f => f.resolveFileStat(this.fileService)));
|
|
557
|
+
const files = ( (searchResult.matches().filter(f => !f.fileStat).map(f => f.resolveFileStat(this.fileService))));
|
|
579
558
|
await Promise.all(files);
|
|
580
559
|
}
|
|
581
560
|
layout(dimension) {
|
|
@@ -691,7 +670,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
691
670
|
if (!editorViewState) {
|
|
692
671
|
return undefined;
|
|
693
672
|
}
|
|
694
|
-
if (( resource.toString()) !== this.getInput()?.modelUri.toString()) {
|
|
673
|
+
if (( (resource.toString())) !== this.getInput()?.modelUri.toString()) {
|
|
695
674
|
return undefined;
|
|
696
675
|
}
|
|
697
676
|
return { ...editorViewState, focused: this.searchResultEditor.hasWidgetFocus() ? 'editor' : 'input' };
|
|
@@ -706,38 +685,30 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
706
685
|
}
|
|
707
686
|
}
|
|
708
687
|
getAriaLabel() {
|
|
709
|
-
return this.getInput()?.getName() ?? ( localizeWithPath(
|
|
710
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor',
|
|
711
|
-
'searchEditor',
|
|
712
|
-
"Search"
|
|
713
|
-
));
|
|
688
|
+
return this.getInput()?.getName() ?? ( localizeWithPath(_moduleId, 7, "Search"));
|
|
714
689
|
}
|
|
715
690
|
};
|
|
716
|
-
SearchEditor = SearchEditor_1 = ( __decorate([
|
|
717
|
-
( __param(1, ITelemetryService)),
|
|
718
|
-
( __param(2, IThemeService)),
|
|
719
|
-
( __param(3, IStorageService)),
|
|
720
|
-
( __param(4, IModelService)),
|
|
721
|
-
( __param(5, IWorkspaceContextService)),
|
|
722
|
-
( __param(6, ILabelService)),
|
|
723
|
-
( __param(7, IInstantiationService)),
|
|
724
|
-
( __param(8, IContextViewService)),
|
|
725
|
-
( __param(9, ICommandService)),
|
|
726
|
-
( __param(10, IOpenerService)),
|
|
727
|
-
( __param(11, INotificationService)),
|
|
728
|
-
( __param(12, IEditorProgressService)),
|
|
729
|
-
( __param(13, ITextResourceConfigurationService)),
|
|
730
|
-
( __param(14, IEditorGroupsService)),
|
|
731
|
-
( __param(15, IEditorService)),
|
|
732
|
-
( __param(16, IConfigurationService)),
|
|
733
|
-
( __param(17, IFileService)),
|
|
734
|
-
( __param(18, ILogService))
|
|
735
|
-
], SearchEditor));
|
|
736
|
-
const searchEditorTextInputBorder = registerColor('searchEditor.textInputBorder', { dark: inputBorder, light: inputBorder, hcDark: inputBorder, hcLight: inputBorder }, ( localizeWithPath(
|
|
737
|
-
'vs/workbench/contrib/searchEditor/browser/searchEditor',
|
|
738
|
-
'textInputBoxBorder',
|
|
739
|
-
"Search editor text input box border."
|
|
740
|
-
)));
|
|
691
|
+
SearchEditor = SearchEditor_1 = ( (__decorate([
|
|
692
|
+
( (__param(1, ITelemetryService))),
|
|
693
|
+
( (__param(2, IThemeService))),
|
|
694
|
+
( (__param(3, IStorageService))),
|
|
695
|
+
( (__param(4, IModelService))),
|
|
696
|
+
( (__param(5, IWorkspaceContextService))),
|
|
697
|
+
( (__param(6, ILabelService))),
|
|
698
|
+
( (__param(7, IInstantiationService))),
|
|
699
|
+
( (__param(8, IContextViewService))),
|
|
700
|
+
( (__param(9, ICommandService))),
|
|
701
|
+
( (__param(10, IOpenerService))),
|
|
702
|
+
( (__param(11, INotificationService))),
|
|
703
|
+
( (__param(12, IEditorProgressService))),
|
|
704
|
+
( (__param(13, ITextResourceConfigurationService))),
|
|
705
|
+
( (__param(14, IEditorGroupsService))),
|
|
706
|
+
( (__param(15, IEditorService))),
|
|
707
|
+
( (__param(16, IConfigurationService))),
|
|
708
|
+
( (__param(17, IFileService))),
|
|
709
|
+
( (__param(18, ILogService)))
|
|
710
|
+
], SearchEditor)));
|
|
711
|
+
const searchEditorTextInputBorder = registerColor('searchEditor.textInputBorder', { dark: inputBorder, light: inputBorder, hcDark: inputBorder, hcLight: inputBorder }, ( localizeWithPath(_moduleId, 8, "Search editor text input box border.")));
|
|
741
712
|
function findNextRange(matchRanges, currentPosition) {
|
|
742
713
|
for (const matchRange of matchRanges) {
|
|
743
714
|
if (Position.isBefore(currentPosition, matchRange.getStartPosition())) {
|
|
@@ -134,7 +134,7 @@ const openNewSearchEditor = async (accessor, _args = {}, toSide = false) => {
|
|
|
134
134
|
if (existing && args.location === 'reuse') {
|
|
135
135
|
const group = editorGroupsService.getGroup(existing.groupId);
|
|
136
136
|
if (!group) {
|
|
137
|
-
throw new Error('Invalid group id for search editor');
|
|
137
|
+
throw ( new Error('Invalid group id for search editor'));
|
|
138
138
|
}
|
|
139
139
|
const input = existing.editor;
|
|
140
140
|
editor = (await group.openEditor(input));
|