@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.
- package/common.d.ts +2 -0
- package/common.js +84 -0
- package/index.js +3 -76
- package/package.json +10 -2
- package/session.d.ts +2 -0
- package/session.js +10 -0
- package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +13 -9
- package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +39 -39
- package/vscode/src/vs/workbench/contrib/search/browser/searchAccessibilityHelp.js +55 -55
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +7 -7
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +17 -17
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +17 -17
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +4 -4
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/searchResult.js +2 -2
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +16 -16
- package/vscode/src/vs/workbench/services/search/browser/searchService.js +6 -6
- package/vscode/src/vs/workbench/services/search/common/searchService.js +4 -4
- package/vscode/src/vs/workbench/services/search/worker/localFileSearch.js +12 -10
- package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +0 -15
- package/vscode/src/vs/workbench/contrib/search/browser/replaceService.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +0 -264
- package/vscode/src/vs/workbench/contrib/search/browser/search.common.contribution.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/search/browser/search.common.contribution.js +0 -148
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +0 -41
- package/vscode/src/vs/workbench/contrib/search/browser/searchQuickAccess.contribution.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchQuickAccess.contribution.js +0 -38
|
@@ -55,24 +55,24 @@ const SelectAllSearchEditorMatchesCommandId = "selectAllSearchEditorMatches";
|
|
|
55
55
|
type: "string",
|
|
56
56
|
enum: ["selectWord", "goToLocation", "openLocationToSide"],
|
|
57
57
|
default: "goToLocation",
|
|
58
|
-
enumDescriptions: [( localize(
|
|
59
|
-
|
|
58
|
+
enumDescriptions: [( localize(18304, "Double-clicking selects the word under the cursor.")), ( localize(18305, "Double-clicking opens the result in the active editor group.")), ( localize(
|
|
59
|
+
18306,
|
|
60
60
|
"Double-clicking opens the result in the editor group to the side, creating one if it does not yet exist."
|
|
61
61
|
))],
|
|
62
|
-
markdownDescription: ( localize(
|
|
62
|
+
markdownDescription: ( localize(18307, "Configure effect of double-clicking a result in a search editor."))
|
|
63
63
|
},
|
|
64
64
|
"search.searchEditor.singleClickBehaviour": {
|
|
65
65
|
type: "string",
|
|
66
66
|
enum: ["default", "peekDefinition"],
|
|
67
67
|
default: "default",
|
|
68
|
-
enumDescriptions: [( localize(
|
|
69
|
-
markdownDescription: ( localize(
|
|
68
|
+
enumDescriptions: [( localize(18308, "Single-clicking does nothing.")), ( localize(18309, "Single-clicking opens a Peek Definition window."))],
|
|
69
|
+
markdownDescription: ( localize(18310, "Configure effect of single-clicking a result in a search editor."))
|
|
70
70
|
},
|
|
71
71
|
"search.searchEditor.reusePriorSearchConfiguration": {
|
|
72
72
|
type: "boolean",
|
|
73
73
|
default: false,
|
|
74
74
|
markdownDescription: ( localize(
|
|
75
|
-
|
|
75
|
+
18311,
|
|
76
76
|
"When enabled, new Search Editors will reuse the includes, excludes, and flags of the previously opened Search Editor."
|
|
77
77
|
))
|
|
78
78
|
},
|
|
@@ -80,7 +80,7 @@ const SelectAllSearchEditorMatchesCommandId = "selectAllSearchEditorMatches";
|
|
|
80
80
|
type: ["number", "null"],
|
|
81
81
|
default: 1,
|
|
82
82
|
markdownDescription: ( localize(
|
|
83
|
-
|
|
83
|
+
18312,
|
|
84
84
|
"The default number of surrounding context lines to use when creating new Search Editors. If using `#search.searchEditor.reusePriorSearchConfiguration#`, this can be set to `null` (empty) to use the prior Search Editor's configuration."
|
|
85
85
|
))
|
|
86
86
|
},
|
|
@@ -88,13 +88,13 @@ const SelectAllSearchEditorMatchesCommandId = "selectAllSearchEditorMatches";
|
|
|
88
88
|
type: "boolean",
|
|
89
89
|
default: false,
|
|
90
90
|
markdownDescription: ( localize(
|
|
91
|
-
|
|
91
|
+
18313,
|
|
92
92
|
"When a search is triggered, focus the Search Editor results instead of the Search Editor input."
|
|
93
93
|
))
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(SearchEditor, SearchEditor.ID, ( localize(
|
|
97
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(SearchEditor, SearchEditor.ID, ( localize(18314, "Search Editor"))), [( new SyncDescriptor(SearchEditorInput))]);
|
|
98
98
|
let SearchEditorContribution = class SearchEditorContribution {
|
|
99
99
|
static {
|
|
100
100
|
this.ID = "workbench.contrib.searchEditor";
|
|
@@ -102,7 +102,7 @@ let SearchEditorContribution = class SearchEditorContribution {
|
|
|
102
102
|
constructor(editorResolverService, instantiationService) {
|
|
103
103
|
editorResolverService.registerEditor("*" + SEARCH_EDITOR_EXT, {
|
|
104
104
|
id: SearchEditorInput.ID,
|
|
105
|
-
label: ( localize(
|
|
105
|
+
label: ( localize(18315, "Search Editor")),
|
|
106
106
|
detail: DEFAULT_EDITOR_ASSOCIATION.providerDisplayName,
|
|
107
107
|
priority: RegisteredEditorPriority.default
|
|
108
108
|
}, {
|
|
@@ -209,7 +209,7 @@ CommandsRegistry.registerCommand(CleanSearchEditorStateCommandId, accessor => {
|
|
|
209
209
|
activeEditorPane.cleanState();
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
|
-
const category = ( localize2(
|
|
212
|
+
const category = ( localize2(18316, "Search Editor"));
|
|
213
213
|
const translateLegacyConfig = (legacyConfig = {}) => {
|
|
214
214
|
const config = {};
|
|
215
215
|
const overrides = {
|
|
@@ -275,7 +275,7 @@ registerAction2(class extends Action2 {
|
|
|
275
275
|
constructor() {
|
|
276
276
|
super({
|
|
277
277
|
id: "search.searchEditor.action.deleteFileResults",
|
|
278
|
-
title: ( localize2(
|
|
278
|
+
title: ( localize2(18317, "Delete File Results")),
|
|
279
279
|
keybinding: {
|
|
280
280
|
weight: KeybindingWeight.EditorContrib,
|
|
281
281
|
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Backspace
|
|
@@ -296,7 +296,7 @@ registerAction2(class extends Action2 {
|
|
|
296
296
|
constructor() {
|
|
297
297
|
super({
|
|
298
298
|
id: OpenNewEditorCommandId,
|
|
299
|
-
title: ( localize2(
|
|
299
|
+
title: ( localize2(18318, "New Search Editor")),
|
|
300
300
|
category,
|
|
301
301
|
f1: true,
|
|
302
302
|
metadata: openArgMetadata
|
|
@@ -313,7 +313,7 @@ registerAction2(class extends Action2 {
|
|
|
313
313
|
constructor() {
|
|
314
314
|
super({
|
|
315
315
|
id: OpenEditorCommandId,
|
|
316
|
-
title: ( localize2(
|
|
316
|
+
title: ( localize2(18319, "Open Search Editor")),
|
|
317
317
|
category,
|
|
318
318
|
f1: true,
|
|
319
319
|
metadata: openArgMetadata
|
|
@@ -330,7 +330,7 @@ registerAction2(class extends Action2 {
|
|
|
330
330
|
constructor() {
|
|
331
331
|
super({
|
|
332
332
|
id: OpenNewEditorToSideCommandId,
|
|
333
|
-
title: ( localize2(
|
|
333
|
+
title: ( localize2(18320, "Open New Search Editor to the Side")),
|
|
334
334
|
category,
|
|
335
335
|
f1: true,
|
|
336
336
|
metadata: openArgMetadata
|
|
@@ -344,7 +344,7 @@ registerAction2(class extends Action2 {
|
|
|
344
344
|
constructor() {
|
|
345
345
|
super({
|
|
346
346
|
id: OpenInEditorCommandId,
|
|
347
|
-
title: ( localize2(
|
|
347
|
+
title: ( localize2(18321, "Open Results in Editor")),
|
|
348
348
|
category,
|
|
349
349
|
f1: true,
|
|
350
350
|
keybinding: {
|
|
@@ -379,7 +379,7 @@ registerAction2(class extends Action2 {
|
|
|
379
379
|
constructor() {
|
|
380
380
|
super({
|
|
381
381
|
id: RerunSearchEditorSearchCommandId,
|
|
382
|
-
title: ( localize2(
|
|
382
|
+
title: ( localize2(18322, "Search Again")),
|
|
383
383
|
category,
|
|
384
384
|
keybinding: {
|
|
385
385
|
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyR,
|
|
@@ -387,11 +387,11 @@ registerAction2(class extends Action2 {
|
|
|
387
387
|
weight: KeybindingWeight.EditorContrib
|
|
388
388
|
},
|
|
389
389
|
icon: searchRefreshIcon,
|
|
390
|
-
menu: [...
|
|
390
|
+
menu: [...[MenuId.EditorTitle, MenuId.CompactWindowEditorTitle].map(id => ({
|
|
391
391
|
id,
|
|
392
392
|
group: "navigation",
|
|
393
393
|
when: ( ActiveEditorContext.isEqualTo(SearchEditorID))
|
|
394
|
-
}))
|
|
394
|
+
})), {
|
|
395
395
|
id: MenuId.CommandPalette,
|
|
396
396
|
when: ( ActiveEditorContext.isEqualTo(SearchEditorID))
|
|
397
397
|
}]
|
|
@@ -411,7 +411,7 @@ registerAction2(class extends Action2 {
|
|
|
411
411
|
constructor() {
|
|
412
412
|
super({
|
|
413
413
|
id: FocusQueryEditorWidgetCommandId,
|
|
414
|
-
title: ( localize2(
|
|
414
|
+
title: ( localize2(18323, "Focus Search Editor Input")),
|
|
415
415
|
category,
|
|
416
416
|
f1: true,
|
|
417
417
|
precondition: InSearchEditor,
|
|
@@ -433,7 +433,7 @@ registerAction2(class extends Action2 {
|
|
|
433
433
|
constructor() {
|
|
434
434
|
super({
|
|
435
435
|
id: FocusQueryEditorFilesToIncludeCommandId,
|
|
436
|
-
title: ( localize2(
|
|
436
|
+
title: ( localize2(18324, "Focus Search Editor Files to Include")),
|
|
437
437
|
category,
|
|
438
438
|
f1: true,
|
|
439
439
|
precondition: InSearchEditor
|
|
@@ -451,7 +451,7 @@ registerAction2(class extends Action2 {
|
|
|
451
451
|
constructor() {
|
|
452
452
|
super({
|
|
453
453
|
id: FocusQueryEditorFilesToExcludeCommandId,
|
|
454
|
-
title: ( localize2(
|
|
454
|
+
title: ( localize2(18325, "Focus Search Editor Files to Exclude")),
|
|
455
455
|
category,
|
|
456
456
|
f1: true,
|
|
457
457
|
precondition: InSearchEditor
|
|
@@ -469,7 +469,7 @@ registerAction2(class extends Action2 {
|
|
|
469
469
|
constructor() {
|
|
470
470
|
super({
|
|
471
471
|
id: ToggleSearchEditorCaseSensitiveCommandId,
|
|
472
|
-
title: ( localize2(
|
|
472
|
+
title: ( localize2(18326, "Toggle Match Case")),
|
|
473
473
|
category,
|
|
474
474
|
f1: true,
|
|
475
475
|
precondition: InSearchEditor,
|
|
@@ -487,7 +487,7 @@ registerAction2(class extends Action2 {
|
|
|
487
487
|
constructor() {
|
|
488
488
|
super({
|
|
489
489
|
id: ToggleSearchEditorWholeWordCommandId,
|
|
490
|
-
title: ( localize2(
|
|
490
|
+
title: ( localize2(18327, "Toggle Match Whole Word")),
|
|
491
491
|
category,
|
|
492
492
|
f1: true,
|
|
493
493
|
precondition: InSearchEditor,
|
|
@@ -505,7 +505,7 @@ registerAction2(class extends Action2 {
|
|
|
505
505
|
constructor() {
|
|
506
506
|
super({
|
|
507
507
|
id: ToggleSearchEditorRegexCommandId,
|
|
508
|
-
title: ( localize2(
|
|
508
|
+
title: ( localize2(18328, "Toggle Use Regular Expression")),
|
|
509
509
|
category,
|
|
510
510
|
f1: true,
|
|
511
511
|
precondition: InSearchEditor,
|
|
@@ -523,7 +523,7 @@ registerAction2(class extends Action2 {
|
|
|
523
523
|
constructor() {
|
|
524
524
|
super({
|
|
525
525
|
id: ToggleSearchEditorContextLinesCommandId,
|
|
526
|
-
title: ( localize2(
|
|
526
|
+
title: ( localize2(18329, "Toggle Context Lines")),
|
|
527
527
|
category,
|
|
528
528
|
f1: true,
|
|
529
529
|
precondition: InSearchEditor,
|
|
@@ -544,7 +544,7 @@ registerAction2(class extends Action2 {
|
|
|
544
544
|
constructor() {
|
|
545
545
|
super({
|
|
546
546
|
id: IncreaseSearchEditorContextLinesCommandId,
|
|
547
|
-
title: ( localize2(
|
|
547
|
+
title: ( localize2(18330, "Increase Context Lines")),
|
|
548
548
|
category,
|
|
549
549
|
f1: true,
|
|
550
550
|
precondition: InSearchEditor,
|
|
@@ -562,7 +562,7 @@ registerAction2(class extends Action2 {
|
|
|
562
562
|
constructor() {
|
|
563
563
|
super({
|
|
564
564
|
id: DecreaseSearchEditorContextLinesCommandId,
|
|
565
|
-
title: ( localize2(
|
|
565
|
+
title: ( localize2(18331, "Decrease Context Lines")),
|
|
566
566
|
category,
|
|
567
567
|
f1: true,
|
|
568
568
|
precondition: InSearchEditor,
|
|
@@ -580,7 +580,7 @@ registerAction2(class extends Action2 {
|
|
|
580
580
|
constructor() {
|
|
581
581
|
super({
|
|
582
582
|
id: SelectAllSearchEditorMatchesCommandId,
|
|
583
|
-
title: ( localize2(
|
|
583
|
+
title: ( localize2(18332, "Select All Matches")),
|
|
584
584
|
category,
|
|
585
585
|
f1: true,
|
|
586
586
|
precondition: InSearchEditor,
|
|
@@ -598,7 +598,7 @@ registerAction2(class OpenSearchEditorAction extends Action2 {
|
|
|
598
598
|
constructor() {
|
|
599
599
|
super({
|
|
600
600
|
id: "search.action.openNewEditorFromView",
|
|
601
|
-
title: ( localize(
|
|
601
|
+
title: ( localize(18333, "Open New Search Editor")),
|
|
602
602
|
category,
|
|
603
603
|
icon: searchNewEditorIcon,
|
|
604
604
|
menu: [{
|
|
@@ -67,7 +67,7 @@ import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
67
67
|
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
68
68
|
|
|
69
69
|
var SearchEditor_1;
|
|
70
|
-
registerCss(searchEditor);
|
|
70
|
+
registerCss(searchEditor, 1);
|
|
71
71
|
const RESULT_LINE_REGEX = /^(\s+)(\d+)(: | )(\s*)(.*)$/;
|
|
72
72
|
const FILE_LINE_REGEX = /^(\S.*):$/;
|
|
73
73
|
const DEFAULT_QUERY_EDITOR_LAYOUT_OFFSET = 28;
|
|
@@ -187,7 +187,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
187
187
|
resetCursor: false
|
|
188
188
|
})));
|
|
189
189
|
this.includesExcludesContainer = append(container, $(".includes-excludes"));
|
|
190
|
-
const toggleQueryDetailsLabel = ( localize(
|
|
190
|
+
const toggleQueryDetailsLabel = ( localize(18334, "Toggle Search Details"));
|
|
191
191
|
this.toggleQueryDetailsButton = append(
|
|
192
192
|
this.includesExcludesContainer,
|
|
193
193
|
$(".expand" + ThemeIcon.asCSSSelector(searchDetailsIcon), {
|
|
@@ -230,11 +230,11 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
230
230
|
})
|
|
231
231
|
);
|
|
232
232
|
const folderIncludesList = append(this.includesExcludesContainer, $(".file-types.includes"));
|
|
233
|
-
const filesToIncludeTitle = ( localize(
|
|
233
|
+
const filesToIncludeTitle = ( localize(18335, "files to include"));
|
|
234
234
|
append(folderIncludesList, $("h4", undefined, filesToIncludeTitle));
|
|
235
235
|
this.inputPatternIncludes = this._register(
|
|
236
236
|
scopedInstantiationService.createInstance(IncludePatternInputWidget, folderIncludesList, this.contextViewService, {
|
|
237
|
-
ariaLabel: ( localize(
|
|
237
|
+
ariaLabel: ( localize(18336, "Search Include Patterns")),
|
|
238
238
|
inputBoxStyles: searchEditorInputboxStyles
|
|
239
239
|
})
|
|
240
240
|
);
|
|
@@ -246,11 +246,11 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
246
246
|
this.inputPatternIncludes.onChangeSearchInEditorsBox(() => this.triggerSearch())
|
|
247
247
|
);
|
|
248
248
|
const excludesList = append(this.includesExcludesContainer, $(".file-types.excludes"));
|
|
249
|
-
const excludesTitle = ( localize(
|
|
249
|
+
const excludesTitle = ( localize(18337, "files to exclude"));
|
|
250
250
|
append(excludesList, $("h4", undefined, excludesTitle));
|
|
251
251
|
this.inputPatternExcludes = this._register(
|
|
252
252
|
scopedInstantiationService.createInstance(ExcludePatternInputWidget, excludesList, this.contextViewService, {
|
|
253
|
-
ariaLabel: ( localize(
|
|
253
|
+
ariaLabel: ( localize(18338, "Search Exclude Patterns")),
|
|
254
254
|
inputBoxStyles: searchEditorInputboxStyles
|
|
255
255
|
})
|
|
256
256
|
);
|
|
@@ -279,7 +279,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
279
279
|
clearNode(this.messageBox);
|
|
280
280
|
this.messageDisposables.clear();
|
|
281
281
|
if (show) {
|
|
282
|
-
const runAgainLink = append(this.messageBox, $("a.pointer.prominent.message", {}, ( localize(
|
|
282
|
+
const runAgainLink = append(this.messageBox, $("a.pointer.prominent.message", {}, ( localize(18339, "Run Search"))));
|
|
283
283
|
this.messageDisposables.add(addDisposableListener(runAgainLink, EventType.CLICK, async () => {
|
|
284
284
|
await this.triggerSearch();
|
|
285
285
|
this.searchResultEditor.focus();
|
|
@@ -456,10 +456,10 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
456
456
|
endingCursorLines.push(1);
|
|
457
457
|
}
|
|
458
458
|
const isDefined = x => x !== undefined;
|
|
459
|
-
model.pushEditOperations(this.searchResultEditor.getSelections(),
|
|
459
|
+
model.pushEditOperations(this.searchResultEditor.getSelections(), [...linesToDelete].map(line => ({
|
|
460
460
|
range: ( new Range(line, 1, line + 1, 1)),
|
|
461
461
|
text: ""
|
|
462
|
-
}))
|
|
462
|
+
})), () => endingCursorLines.filter(isDefined).map(line => ( new Selection(line, 1, line, 1))));
|
|
463
463
|
}
|
|
464
464
|
cleanState() {
|
|
465
465
|
this.getInput()?.setDirty(false);
|
|
@@ -498,7 +498,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
alert(( localize(
|
|
501
|
-
|
|
501
|
+
18340,
|
|
502
502
|
"Matched {0} at {1} in file {2}",
|
|
503
503
|
matchText,
|
|
504
504
|
matchLineText,
|
|
@@ -512,12 +512,12 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
512
512
|
this.iterateThroughMatches(true);
|
|
513
513
|
}
|
|
514
514
|
focusAllResults() {
|
|
515
|
-
this.searchResultEditor.setSelections((
|
|
515
|
+
this.searchResultEditor.setSelections((this.getInput()?.getMatchRanges() ?? []).map(range => ( new Selection(
|
|
516
516
|
range.startLineNumber,
|
|
517
517
|
range.startColumn,
|
|
518
518
|
range.endLineNumber,
|
|
519
519
|
range.endColumn
|
|
520
|
-
))))
|
|
520
|
+
))));
|
|
521
521
|
this.searchResultEditor.focus();
|
|
522
522
|
}
|
|
523
523
|
async triggerSearch(_options) {
|
|
@@ -624,7 +624,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
624
624
|
let query;
|
|
625
625
|
try {
|
|
626
626
|
const queryBuilder = this.instantiationService.createInstance(QueryBuilder);
|
|
627
|
-
query = queryBuilder.text(content,
|
|
627
|
+
query = queryBuilder.text(content, folderResources.map(folder => folder.uri), options);
|
|
628
628
|
} catch (err) {
|
|
629
629
|
return;
|
|
630
630
|
}
|
|
@@ -701,7 +701,7 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
701
701
|
));
|
|
702
702
|
}
|
|
703
703
|
async retrieveFileStats(searchResult) {
|
|
704
|
-
const files =
|
|
704
|
+
const files = searchResult.matches().filter(f => !f.fileStat).map(f => f.resolveFileStat(this.fileService));
|
|
705
705
|
await Promise.all(files);
|
|
706
706
|
}
|
|
707
707
|
layout(dimension) {
|
|
@@ -846,11 +846,11 @@ let SearchEditor = class SearchEditor extends AbstractTextCodeEditor {
|
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
getAriaLabel() {
|
|
849
|
-
return this.getInput()?.getName() ?? ( localize(
|
|
849
|
+
return this.getInput()?.getName() ?? ( localize(18341, "Search"));
|
|
850
850
|
}
|
|
851
851
|
};
|
|
852
852
|
SearchEditor = SearchEditor_1 = ( __decorate([( __param(1, ITelemetryService)), ( __param(2, IThemeService)), ( __param(3, IStorageService)), ( __param(4, IModelService)), ( __param(5, IWorkspaceContextService)), ( __param(6, ILabelService)), ( __param(7, IInstantiationService)), ( __param(8, IContextViewService)), ( __param(9, ICommandService)), ( __param(10, IOpenerService)), ( __param(11, INotificationService)), ( __param(12, IEditorProgressService)), ( __param(13, ITextResourceConfigurationService)), ( __param(14, IEditorGroupsService)), ( __param(15, IEditorService)), ( __param(16, IConfigurationService)), ( __param(17, IFileService)), ( __param(18, ILogService)), ( __param(19, IHoverService))], SearchEditor));
|
|
853
|
-
const searchEditorTextInputBorder = registerColor("searchEditor.textInputBorder", inputBorder, ( localize(
|
|
853
|
+
const searchEditorTextInputBorder = registerColor("searchEditor.textInputBorder", inputBorder, ( localize(18342, "Search editor text input box border.")));
|
|
854
854
|
function findNextRange(matchRanges, currentPosition) {
|
|
855
855
|
for (const matchRange of matchRanges) {
|
|
856
856
|
if (Position.isBefore(currentPosition, matchRange.getStartPosition())) {
|
|
@@ -53,7 +53,7 @@ let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disp
|
|
|
53
53
|
const proxy = this._getOrCreateWorker().proxy;
|
|
54
54
|
const results = [];
|
|
55
55
|
let limitHit = false;
|
|
56
|
-
await Promise.all(
|
|
56
|
+
await Promise.all(query.folderQueries.map(async fq => {
|
|
57
57
|
const queryId = this.queryId++;
|
|
58
58
|
queryDisposables.add(
|
|
59
59
|
token?.onCancellationRequested(e => this.cancelQuery(queryId)) || Disposable.None
|
|
@@ -80,7 +80,7 @@ let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disp
|
|
|
80
80
|
if (folderResults.limitHit) {
|
|
81
81
|
limitHit = true;
|
|
82
82
|
}
|
|
83
|
-
}))
|
|
83
|
+
}));
|
|
84
84
|
queryDisposables.dispose();
|
|
85
85
|
const result = {
|
|
86
86
|
messages: [],
|
|
@@ -93,7 +93,7 @@ let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disp
|
|
|
93
93
|
return {
|
|
94
94
|
results: [],
|
|
95
95
|
messages: [{
|
|
96
|
-
text: ( localize(
|
|
96
|
+
text: ( localize(22157, "Unable to search with Web Worker text searcher")),
|
|
97
97
|
type: TextSearchCompleteMessageType.Warning
|
|
98
98
|
}]
|
|
99
99
|
};
|
|
@@ -105,7 +105,7 @@ let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disp
|
|
|
105
105
|
let limitHit = false;
|
|
106
106
|
const proxy = this._getOrCreateWorker().proxy;
|
|
107
107
|
const results = [];
|
|
108
|
-
await Promise.all(
|
|
108
|
+
await Promise.all(query.folderQueries.map(async fq => {
|
|
109
109
|
const queryId = this.queryId++;
|
|
110
110
|
queryDisposables.add(
|
|
111
111
|
token?.onCancellationRequested(e => this.cancelQuery(queryId)) || Disposable.None
|
|
@@ -125,7 +125,7 @@ let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disp
|
|
|
125
125
|
if (folderResults.limitHit) {
|
|
126
126
|
limitHit = true;
|
|
127
127
|
}
|
|
128
|
-
}))
|
|
128
|
+
}));
|
|
129
129
|
queryDisposables.dispose();
|
|
130
130
|
const result = {
|
|
131
131
|
messages: [],
|
|
@@ -138,7 +138,7 @@ let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disp
|
|
|
138
138
|
return {
|
|
139
139
|
results: [],
|
|
140
140
|
messages: [{
|
|
141
|
-
text: ( localize(
|
|
141
|
+
text: ( localize(22158, "Unable to search with Web Worker file searcher")),
|
|
142
142
|
type: TextSearchCompleteMessageType.Warning
|
|
143
143
|
}]
|
|
144
144
|
};
|
|
@@ -162,7 +162,7 @@ let SearchService = class SearchService extends Disposable {
|
|
|
162
162
|
}
|
|
163
163
|
onProgress?.(item);
|
|
164
164
|
};
|
|
165
|
-
const exists = await Promise.all(
|
|
165
|
+
const exists = await Promise.all(query.folderQueries.map(query => this.fileService.exists(query.folder)));
|
|
166
166
|
query.folderQueries = query.folderQueries.filter((_, i) => exists[i]);
|
|
167
167
|
let completes = await this.searchWithProviders(query, progressCallback, token);
|
|
168
168
|
completes = coalesce(completes);
|
|
@@ -232,7 +232,7 @@ let SearchService = class SearchService extends Disposable {
|
|
|
232
232
|
const someSchemeHasProvider = ( [...( fqs.keys())].some(scheme => {
|
|
233
233
|
return ( this.getSearchProvider(query.type).has(scheme));
|
|
234
234
|
}));
|
|
235
|
-
await Promise.all(
|
|
235
|
+
await Promise.all([...( fqs.keys())].map(async scheme => {
|
|
236
236
|
if (query.onlyFileScheme && scheme !== Schemas.file) {
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
@@ -272,7 +272,7 @@ let SearchService = class SearchService extends Disposable {
|
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
274
|
searchPs.push(doProviderSearch());
|
|
275
|
-
}))
|
|
275
|
+
}));
|
|
276
276
|
return Promise.all(searchPs).then(completes => {
|
|
277
277
|
const endToEndTime = e2eSW.elapsed();
|
|
278
278
|
this.logService.trace(`SearchService#search: ${endToEndTime}ms`);
|
|
@@ -425,7 +425,7 @@ let SearchService = class SearchService extends Disposable {
|
|
|
425
425
|
return pathIncludedInQuery(query, resource.fsPath);
|
|
426
426
|
}
|
|
427
427
|
async clearCache(cacheKey) {
|
|
428
|
-
const clearPs =
|
|
428
|
+
const clearPs = Array.from(( this.fileSearchProviders.values())).map(provider => provider && provider.clearCache(cacheKey));
|
|
429
429
|
await Promise.all(clearPs);
|
|
430
430
|
}
|
|
431
431
|
};
|
|
@@ -166,13 +166,13 @@ class LocalFileSearchWorker {
|
|
|
166
166
|
directory.getFileHandle(".gitignore").catch(e => undefined),
|
|
167
167
|
directory.getFileHandle(".ignore").catch(e => undefined)
|
|
168
168
|
]);
|
|
169
|
-
await Promise.all(
|
|
169
|
+
await Promise.all(ignoreFiles.map(async file => {
|
|
170
170
|
if (!file) {
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
const ignoreContents = ( new TextDecoder("utf8")).decode(( new Uint8Array(await (await file.getFile()).arrayBuffer())));
|
|
174
174
|
ignoreFile = ( new IgnoreFile(ignoreContents, prior, ignoreFile, ignoreGlobCase));
|
|
175
|
-
}))
|
|
175
|
+
}));
|
|
176
176
|
}
|
|
177
177
|
const entries = Promises.withAsyncBody(async c => {
|
|
178
178
|
const files = [];
|
|
@@ -210,13 +210,15 @@ class LocalFileSearchWorker {
|
|
|
210
210
|
if (token.isCancellationRequested) {
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
await Promise.all(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
213
|
+
await Promise.all(
|
|
214
|
+
(await directory.entries).sort((a, b) => -(a.type === "dir" ? 0 : 1) + (b.type === "dir" ? 0 : 1)).map(async entry => {
|
|
215
|
+
if (entry.type === "dir") {
|
|
216
|
+
return resolveDirectory(entry, onFile);
|
|
217
|
+
} else {
|
|
218
|
+
return onFile(entry);
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
);
|
|
220
222
|
};
|
|
221
223
|
const processed = await time("process", () => processDirectory(handle, "/"));
|
|
222
224
|
await time("resolve", () => resolveDirectory(processed, onFile));
|
|
@@ -245,7 +247,7 @@ function reviveQueryProps(queryProps) {
|
|
|
245
247
|
return {
|
|
246
248
|
...queryProps,
|
|
247
249
|
extraFileResources: queryProps.extraFileResources?.map(r => URI.revive(r)),
|
|
248
|
-
folderQueries:
|
|
250
|
+
folderQueries: queryProps.folderQueries.map(fq => reviveFolderQuery(fq))
|
|
249
251
|
};
|
|
250
252
|
}
|
|
251
253
|
function pathExcludedInQuery(queryProps, fsPath) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function registerContributions(): void;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
3
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
|
-
import { ReplacePreviewContentProvider } from './replaceService.js';
|
|
5
|
-
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
6
|
-
|
|
7
|
-
function registerContributions() {
|
|
8
|
-
registerWorkbenchContribution2(
|
|
9
|
-
ReplacePreviewContentProvider.ID,
|
|
10
|
-
ReplacePreviewContentProvider,
|
|
11
|
-
WorkbenchPhase.BlockStartup
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { registerContributions };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
-
import { IReplaceService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/replace.service";
|
|
3
|
-
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
4
|
-
import { IProgress, IProgressStep } from "@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress";
|
|
5
|
-
import { ITextModelContentProvider } from "@codingame/monaco-vscode-model-service-override/vscode/vs/editor/common/services/resolverService";
|
|
6
|
-
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
7
|
-
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
8
|
-
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
9
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
10
|
-
import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
|
|
11
|
-
import { IBulkEditService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService.service";
|
|
12
|
-
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
13
|
-
import { INotebookEditorModelResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service";
|
|
14
|
-
import { ISearchTreeFileMatch, ISearchTreeMatch, FileMatchOrMatch } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/search/browser/searchTreeModel/searchTreeCommon";
|
|
15
|
-
export declare class ReplacePreviewContentProvider implements ITextModelContentProvider, IWorkbenchContribution {
|
|
16
|
-
private readonly instantiationService;
|
|
17
|
-
private readonly textModelResolverService;
|
|
18
|
-
static readonly ID = "workbench.contrib.replacePreviewContentProvider";
|
|
19
|
-
constructor(instantiationService: IInstantiationService, textModelResolverService: ITextModelService);
|
|
20
|
-
provideTextContent(uri: URI): Promise<ITextModel> | null;
|
|
21
|
-
}
|
|
22
|
-
export declare class ReplaceService implements IReplaceService {
|
|
23
|
-
private readonly textFileService;
|
|
24
|
-
private readonly editorService;
|
|
25
|
-
private readonly textModelResolverService;
|
|
26
|
-
private readonly bulkEditorService;
|
|
27
|
-
private readonly labelService;
|
|
28
|
-
private readonly notebookEditorModelResolverService;
|
|
29
|
-
readonly _serviceBrand: undefined;
|
|
30
|
-
private static readonly REPLACE_SAVE_SOURCE;
|
|
31
|
-
constructor(textFileService: ITextFileService, editorService: IEditorService, textModelResolverService: ITextModelService, bulkEditorService: IBulkEditService, labelService: ILabelService, notebookEditorModelResolverService: INotebookEditorModelResolverService);
|
|
32
|
-
replace(match: ISearchTreeMatch): Promise<any>;
|
|
33
|
-
replace(files: ISearchTreeFileMatch[], progress?: IProgress<IProgressStep>): Promise<any>;
|
|
34
|
-
replace(match: FileMatchOrMatch, progress?: IProgress<IProgressStep>, resource?: URI): Promise<any>;
|
|
35
|
-
openReplacePreview(element: FileMatchOrMatch, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<any>;
|
|
36
|
-
updateReplacePreview(fileMatch: ISearchTreeFileMatch, override?: boolean): Promise<void>;
|
|
37
|
-
private applyEditsToPreview;
|
|
38
|
-
private createEdits;
|
|
39
|
-
private createEdit;
|
|
40
|
-
}
|