@codingame/monaco-vscode-search-service-override 3.2.3 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/package.json +2 -2
  2. package/search.js +4 -4
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  6. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +0 -776
  7. package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +0 -6
  8. package/vscode/src/vs/workbench/contrib/search/browser/media/searchview.css.js +0 -6
  9. package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +0 -231
  10. package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +0 -342
  11. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +0 -8
  12. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +0 -232
  13. package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +0 -621
  14. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +0 -209
  15. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +0 -511
  16. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +0 -374
  17. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +0 -43
  18. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +0 -44
  19. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +0 -323
  20. package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +0 -47
  21. package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +0 -96
  22. package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +0 -66
  23. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +0 -434
  24. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +0 -2096
  25. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +0 -667
  26. package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +0 -234
  27. package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +0 -87
  28. package/vscode/src/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +0 -6
  29. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +0 -586
  30. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +0 -736
  31. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +0 -189
  32. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +0 -320
  33. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +0 -138
  34. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +0 -293
  35. package/vscode/src/vs/workbench/services/search/common/searchService.js +0 -372
@@ -1,586 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { isEqual, extname } from 'vscode/vscode/vs/base/common/resources';
3
- import { URI } from 'vscode/vscode/vs/base/common/uri';
4
- import { ToggleCaseSensitiveKeybinding, ToggleWholeWordKeybinding, ToggleRegexKeybinding } from 'vscode/vscode/vs/editor/contrib/find/browser/findModel';
5
- import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
6
- import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
7
- import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
8
- import { IContextKeyService, ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
9
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
10
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
11
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
12
- import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
13
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
14
- import { EditorExtensions, DEFAULT_EDITOR_ASSOCIATION } from 'vscode/vscode/vs/workbench/common/editor';
15
- import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
16
- import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
17
- import { getSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
18
- import { searchRefreshIcon, searchNewEditorIcon } from '../../search/browser/searchIcons.js';
19
- import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
20
- import { InSearchEditor, OpenNewEditorCommandId, OpenEditorCommandId, SearchEditorID, ToggleSearchEditorContextLinesCommandId, SearchEditorScheme } from 'vscode/vscode/vs/workbench/contrib/searchEditor/browser/constants';
21
- import { SearchEditor } from './searchEditor.js';
22
- import { openNewSearchEditor, createEditorFromSearchResult, toggleSearchEditorCaseSensitiveCommand, toggleSearchEditorWholeWordCommand, toggleSearchEditorRegexCommand, toggleSearchEditorContextLinesCommand, modifySearchEditorContextLinesCommand, selectAllSearchEditorMatchesCommand, openSearchEditor } from './searchEditorActions.js';
23
- import { SearchEditorInput, getOrMakeSearchEditorInput, SEARCH_EDITOR_EXT } from './searchEditorInput.js';
24
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
25
- import { VIEW_ID } from 'vscode/vscode/vs/workbench/services/search/common/search';
26
- import { RegisteredEditorPriority, IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
27
- import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService';
28
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
29
- import { getActiveElement } from 'vscode/vscode/vs/base/browser/dom';
30
-
31
- const OpenInEditorCommandId = 'search.action.openInEditor';
32
- const OpenNewEditorToSideCommandId = 'search.action.openNewEditorToSide';
33
- const FocusQueryEditorWidgetCommandId = 'search.action.focusQueryEditorWidget';
34
- const FocusQueryEditorFilesToIncludeCommandId = 'search.action.focusFilesToInclude';
35
- const FocusQueryEditorFilesToExcludeCommandId = 'search.action.focusFilesToExclude';
36
- const ToggleSearchEditorCaseSensitiveCommandId = 'toggleSearchEditorCaseSensitive';
37
- const ToggleSearchEditorWholeWordCommandId = 'toggleSearchEditorWholeWord';
38
- const ToggleSearchEditorRegexCommandId = 'toggleSearchEditorRegex';
39
- const IncreaseSearchEditorContextLinesCommandId = 'increaseSearchEditorContextLines';
40
- const DecreaseSearchEditorContextLinesCommandId = 'decreaseSearchEditorContextLines';
41
- const RerunSearchEditorSearchCommandId = 'rerunSearchEditorSearch';
42
- const CleanSearchEditorStateCommandId = 'cleanSearchEditorState';
43
- const SelectAllSearchEditorMatchesCommandId = 'selectAllSearchEditorMatches';
44
- ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(SearchEditor, SearchEditor.ID, ( localizeWithPath(
45
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
46
- 'searchEditor',
47
- "Search Editor"
48
- ))), [
49
- ( new SyncDescriptor(SearchEditorInput))
50
- ]);
51
- let SearchEditorContribution = class SearchEditorContribution {
52
- static { this.ID = 'workbench.contrib.searchEditor'; }
53
- constructor(editorResolverService, instantiationService) {
54
- editorResolverService.registerEditor('*' + SEARCH_EDITOR_EXT, {
55
- id: SearchEditorInput.ID,
56
- label: ( localizeWithPath(
57
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
58
- 'promptOpenWith.searchEditor.displayName',
59
- "Search Editor"
60
- )),
61
- detail: DEFAULT_EDITOR_ASSOCIATION.providerDisplayName,
62
- priority: RegisteredEditorPriority.default,
63
- }, {
64
- singlePerResource: true,
65
- canSupportResource: resource => (extname(resource) === SEARCH_EDITOR_EXT)
66
- }, {
67
- createEditorInput: ({ resource }) => {
68
- return { editor: instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'existingFile', fileUri: resource }) };
69
- }
70
- });
71
- }
72
- };
73
- SearchEditorContribution = ( __decorate([
74
- ( __param(0, IEditorResolverService)),
75
- ( __param(1, IInstantiationService))
76
- ], SearchEditorContribution));
77
- registerWorkbenchContribution2(SearchEditorContribution.ID, SearchEditorContribution, 1 );
78
- class SearchEditorInputSerializer {
79
- canSerialize(input) {
80
- return !!input.tryReadConfigSync();
81
- }
82
- serialize(input) {
83
- if (!this.canSerialize(input)) {
84
- return undefined;
85
- }
86
- if (input.isDisposed()) {
87
- return JSON.stringify({ modelUri: undefined, dirty: false, config: input.tryReadConfigSync(), name: input.getName(), matchRanges: [], backingUri: input.backingUri?.toString() });
88
- }
89
- let modelUri = undefined;
90
- if (input.modelUri.path || input.modelUri.fragment && input.isDirty()) {
91
- modelUri = ( input.modelUri.toString());
92
- }
93
- const config = input.tryReadConfigSync();
94
- const dirty = input.isDirty();
95
- const matchRanges = dirty ? input.getMatchRanges() : [];
96
- const backingUri = input.backingUri;
97
- return JSON.stringify({ modelUri, dirty, config, name: input.getName(), matchRanges, backingUri: backingUri?.toString() });
98
- }
99
- deserialize(instantiationService, serializedEditorInput) {
100
- const { modelUri, dirty, config, matchRanges, backingUri } = JSON.parse(serializedEditorInput);
101
- if (config && (config.query !== undefined)) {
102
- if (modelUri) {
103
- const input = instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'model', modelUri: ( URI.parse(modelUri)), config, backupOf: backingUri ? ( URI.parse(backingUri)) : undefined });
104
- input.setDirty(dirty);
105
- input.setMatchRanges(matchRanges);
106
- return input;
107
- }
108
- else {
109
- if (backingUri) {
110
- return instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'existingFile', fileUri: ( URI.parse(backingUri)) });
111
- }
112
- else {
113
- return instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'rawData', resultsContents: '', config });
114
- }
115
- }
116
- }
117
- return undefined;
118
- }
119
- }
120
- ( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(SearchEditorInput.ID, SearchEditorInputSerializer);
121
- CommandsRegistry.registerCommand(CleanSearchEditorStateCommandId, (accessor) => {
122
- const activeEditorPane = accessor.get(IEditorService).activeEditorPane;
123
- if (activeEditorPane instanceof SearchEditor) {
124
- activeEditorPane.cleanState();
125
- }
126
- });
127
- const category = ( localize2WithPath(
128
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
129
- 'search',
130
- 'Search Editor'
131
- ));
132
- const translateLegacyConfig = (legacyConfig = {}) => {
133
- const config = {};
134
- const overrides = {
135
- includes: 'filesToInclude',
136
- excludes: 'filesToExclude',
137
- wholeWord: 'matchWholeWord',
138
- caseSensitive: 'isCaseSensitive',
139
- regexp: 'isRegexp',
140
- useIgnores: 'useExcludeSettingsAndIgnoreFiles',
141
- };
142
- Object.entries(legacyConfig).forEach(([key, value]) => {
143
- config[overrides[key] ?? key] = value;
144
- });
145
- return config;
146
- };
147
- const openArgMetadata = {
148
- description: 'Open a new search editor. Arguments passed can include variables like ${relativeFileDirname}.',
149
- args: [{
150
- name: 'Open new Search Editor args',
151
- schema: {
152
- properties: {
153
- query: { type: 'string' },
154
- filesToInclude: { type: 'string' },
155
- filesToExclude: { type: 'string' },
156
- contextLines: { type: 'number' },
157
- matchWholeWord: { type: 'boolean' },
158
- isCaseSensitive: { type: 'boolean' },
159
- isRegexp: { type: 'boolean' },
160
- useExcludeSettingsAndIgnoreFiles: { type: 'boolean' },
161
- showIncludesExcludes: { type: 'boolean' },
162
- triggerSearch: { type: 'boolean' },
163
- focusResults: { type: 'boolean' },
164
- onlyOpenEditors: { type: 'boolean' },
165
- }
166
- }
167
- }]
168
- };
169
- registerAction2(class extends Action2 {
170
- constructor() {
171
- super({
172
- id: 'search.searchEditor.action.deleteFileResults',
173
- title: ( localize2WithPath(
174
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
175
- 'searchEditor.deleteResultBlock',
176
- 'Delete File Results'
177
- )),
178
- keybinding: {
179
- weight: 100 ,
180
- primary: 2048 | 1024 | 1 ,
181
- },
182
- precondition: InSearchEditor,
183
- category,
184
- f1: true,
185
- });
186
- }
187
- async run(accessor) {
188
- const contextService = accessor.get(IContextKeyService).getContext(getActiveElement());
189
- if (contextService.getValue(InSearchEditor.serialize())) {
190
- accessor.get(IEditorService).activeEditorPane.deleteResultBlock();
191
- }
192
- }
193
- });
194
- registerAction2(class extends Action2 {
195
- constructor() {
196
- super({
197
- id: OpenNewEditorCommandId,
198
- title: ( localize2WithPath(
199
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
200
- 'search.openNewSearchEditor',
201
- 'New Search Editor'
202
- )),
203
- category,
204
- f1: true,
205
- metadata: openArgMetadata
206
- });
207
- }
208
- async run(accessor, args) {
209
- await accessor.get(IInstantiationService).invokeFunction(openNewSearchEditor, translateLegacyConfig({ location: 'new', ...args }));
210
- }
211
- });
212
- registerAction2(class extends Action2 {
213
- constructor() {
214
- super({
215
- id: OpenEditorCommandId,
216
- title: ( localize2WithPath(
217
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
218
- 'search.openSearchEditor',
219
- 'Open Search Editor'
220
- )),
221
- category,
222
- f1: true,
223
- metadata: openArgMetadata
224
- });
225
- }
226
- async run(accessor, args) {
227
- await accessor.get(IInstantiationService).invokeFunction(openNewSearchEditor, translateLegacyConfig({ location: 'reuse', ...args }));
228
- }
229
- });
230
- registerAction2(class extends Action2 {
231
- constructor() {
232
- super({
233
- id: OpenNewEditorToSideCommandId,
234
- title: ( localize2WithPath(
235
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
236
- 'search.openNewEditorToSide',
237
- 'Open New Search Editor to the Side'
238
- )),
239
- category,
240
- f1: true,
241
- metadata: openArgMetadata
242
- });
243
- }
244
- async run(accessor, args) {
245
- await accessor.get(IInstantiationService).invokeFunction(openNewSearchEditor, translateLegacyConfig(args), true);
246
- }
247
- });
248
- registerAction2(class extends Action2 {
249
- constructor() {
250
- super({
251
- id: OpenInEditorCommandId,
252
- title: ( localize2WithPath(
253
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
254
- 'search.openResultsInEditor',
255
- 'Open Results in Editor'
256
- )),
257
- category,
258
- f1: true,
259
- keybinding: {
260
- primary: 512 | 3 ,
261
- when: ( ContextKeyExpr.and(
262
- SearchContext.HasSearchResults,
263
- SearchContext.SearchViewFocusedKey
264
- )),
265
- weight: 200 ,
266
- mac: {
267
- primary: 2048 | 3
268
- }
269
- },
270
- });
271
- }
272
- async run(accessor) {
273
- const viewsService = accessor.get(IViewsService);
274
- const instantiationService = accessor.get(IInstantiationService);
275
- const searchView = getSearchView(viewsService);
276
- if (searchView) {
277
- await instantiationService.invokeFunction(createEditorFromSearchResult, searchView.searchResult, searchView.searchIncludePattern.getValue(), searchView.searchExcludePattern.getValue(), searchView.searchIncludePattern.onlySearchInOpenEditors());
278
- }
279
- }
280
- });
281
- registerAction2(class extends Action2 {
282
- constructor() {
283
- super({
284
- id: RerunSearchEditorSearchCommandId,
285
- title: ( localize2WithPath(
286
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
287
- 'search.rerunSearchInEditor',
288
- 'Search Again'
289
- )),
290
- category,
291
- keybinding: {
292
- primary: 2048 | 1024 | 48 ,
293
- when: InSearchEditor,
294
- weight: 100
295
- },
296
- icon: searchRefreshIcon,
297
- menu: [{
298
- id: MenuId.EditorTitle,
299
- group: 'navigation',
300
- when: ( ActiveEditorContext.isEqualTo(SearchEditorID))
301
- },
302
- {
303
- id: MenuId.CommandPalette,
304
- when: ( ActiveEditorContext.isEqualTo(SearchEditorID))
305
- }]
306
- });
307
- }
308
- async run(accessor) {
309
- const editorService = accessor.get(IEditorService);
310
- const input = editorService.activeEditor;
311
- if (input instanceof SearchEditorInput) {
312
- editorService.activeEditorPane.triggerSearch({ resetCursor: false });
313
- }
314
- }
315
- });
316
- registerAction2(class extends Action2 {
317
- constructor() {
318
- super({
319
- id: FocusQueryEditorWidgetCommandId,
320
- title: ( localize2WithPath(
321
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
322
- 'search.action.focusQueryEditorWidget',
323
- 'Focus Search Editor Input'
324
- )),
325
- category,
326
- f1: true,
327
- precondition: InSearchEditor,
328
- keybinding: {
329
- primary: 9 ,
330
- weight: 100
331
- }
332
- });
333
- }
334
- async run(accessor) {
335
- const editorService = accessor.get(IEditorService);
336
- const input = editorService.activeEditor;
337
- if (input instanceof SearchEditorInput) {
338
- editorService.activeEditorPane.focusSearchInput();
339
- }
340
- }
341
- });
342
- registerAction2(class extends Action2 {
343
- constructor() {
344
- super({
345
- id: FocusQueryEditorFilesToIncludeCommandId,
346
- title: ( localize2WithPath(
347
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
348
- 'search.action.focusFilesToInclude',
349
- 'Focus Search Editor Files to Include'
350
- )),
351
- category,
352
- f1: true,
353
- precondition: InSearchEditor,
354
- });
355
- }
356
- async run(accessor) {
357
- const editorService = accessor.get(IEditorService);
358
- const input = editorService.activeEditor;
359
- if (input instanceof SearchEditorInput) {
360
- editorService.activeEditorPane.focusFilesToIncludeInput();
361
- }
362
- }
363
- });
364
- registerAction2(class extends Action2 {
365
- constructor() {
366
- super({
367
- id: FocusQueryEditorFilesToExcludeCommandId,
368
- title: ( localize2WithPath(
369
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
370
- 'search.action.focusFilesToExclude',
371
- 'Focus Search Editor Files to Exclude'
372
- )),
373
- category,
374
- f1: true,
375
- precondition: InSearchEditor,
376
- });
377
- }
378
- async run(accessor) {
379
- const editorService = accessor.get(IEditorService);
380
- const input = editorService.activeEditor;
381
- if (input instanceof SearchEditorInput) {
382
- editorService.activeEditorPane.focusFilesToExcludeInput();
383
- }
384
- }
385
- });
386
- registerAction2(class extends Action2 {
387
- constructor() {
388
- super({
389
- id: ToggleSearchEditorCaseSensitiveCommandId,
390
- title: ( localize2WithPath(
391
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
392
- 'searchEditor.action.toggleSearchEditorCaseSensitive',
393
- 'Toggle Match Case'
394
- )),
395
- category,
396
- f1: true,
397
- precondition: InSearchEditor,
398
- keybinding: Object.assign({
399
- weight: 200 ,
400
- when: SearchContext.SearchInputBoxFocusedKey,
401
- }, ToggleCaseSensitiveKeybinding)
402
- });
403
- }
404
- run(accessor) {
405
- toggleSearchEditorCaseSensitiveCommand(accessor);
406
- }
407
- });
408
- registerAction2(class extends Action2 {
409
- constructor() {
410
- super({
411
- id: ToggleSearchEditorWholeWordCommandId,
412
- title: ( localize2WithPath(
413
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
414
- 'searchEditor.action.toggleSearchEditorWholeWord',
415
- 'Toggle Match Whole Word'
416
- )),
417
- category,
418
- f1: true,
419
- precondition: InSearchEditor,
420
- keybinding: Object.assign({
421
- weight: 200 ,
422
- when: SearchContext.SearchInputBoxFocusedKey,
423
- }, ToggleWholeWordKeybinding)
424
- });
425
- }
426
- run(accessor) {
427
- toggleSearchEditorWholeWordCommand(accessor);
428
- }
429
- });
430
- registerAction2(class extends Action2 {
431
- constructor() {
432
- super({
433
- id: ToggleSearchEditorRegexCommandId,
434
- title: ( localize2WithPath(
435
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
436
- 'searchEditor.action.toggleSearchEditorRegex',
437
- "Toggle Use Regular Expression"
438
- )),
439
- category,
440
- f1: true,
441
- precondition: InSearchEditor,
442
- keybinding: Object.assign({
443
- weight: 200 ,
444
- when: SearchContext.SearchInputBoxFocusedKey,
445
- }, ToggleRegexKeybinding)
446
- });
447
- }
448
- run(accessor) {
449
- toggleSearchEditorRegexCommand(accessor);
450
- }
451
- });
452
- registerAction2(class extends Action2 {
453
- constructor() {
454
- super({
455
- id: ToggleSearchEditorContextLinesCommandId,
456
- title: ( localize2WithPath(
457
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
458
- 'searchEditor.action.toggleSearchEditorContextLines',
459
- "Toggle Context Lines"
460
- )),
461
- category,
462
- f1: true,
463
- precondition: InSearchEditor,
464
- keybinding: {
465
- weight: 200 ,
466
- primary: 512 | 42 ,
467
- mac: { primary: 2048 | 512 | 42 }
468
- }
469
- });
470
- }
471
- run(accessor) {
472
- toggleSearchEditorContextLinesCommand(accessor);
473
- }
474
- });
475
- registerAction2(class extends Action2 {
476
- constructor() {
477
- super({
478
- id: IncreaseSearchEditorContextLinesCommandId,
479
- title: ( localize2WithPath(
480
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
481
- 'searchEditor.action.increaseSearchEditorContextLines',
482
- "Increase Context Lines"
483
- )),
484
- category,
485
- f1: true,
486
- precondition: InSearchEditor,
487
- keybinding: {
488
- weight: 200 ,
489
- primary: 512 | 86
490
- }
491
- });
492
- }
493
- run(accessor) { modifySearchEditorContextLinesCommand(accessor, true); }
494
- });
495
- registerAction2(class extends Action2 {
496
- constructor() {
497
- super({
498
- id: DecreaseSearchEditorContextLinesCommandId,
499
- title: ( localize2WithPath(
500
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
501
- 'searchEditor.action.decreaseSearchEditorContextLines',
502
- "Decrease Context Lines"
503
- )),
504
- category,
505
- f1: true,
506
- precondition: InSearchEditor,
507
- keybinding: {
508
- weight: 200 ,
509
- primary: 512 | 88
510
- }
511
- });
512
- }
513
- run(accessor) { modifySearchEditorContextLinesCommand(accessor, false); }
514
- });
515
- registerAction2(class extends Action2 {
516
- constructor() {
517
- super({
518
- id: SelectAllSearchEditorMatchesCommandId,
519
- title: ( localize2WithPath(
520
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
521
- 'searchEditor.action.selectAllSearchEditorMatches',
522
- "Select All Matches"
523
- )),
524
- category,
525
- f1: true,
526
- precondition: InSearchEditor,
527
- keybinding: {
528
- weight: 200 ,
529
- primary: 2048 | 1024 | 42 ,
530
- }
531
- });
532
- }
533
- run(accessor) {
534
- selectAllSearchEditorMatchesCommand(accessor);
535
- }
536
- });
537
- registerAction2(class OpenSearchEditorAction extends Action2 {
538
- constructor() {
539
- super({
540
- id: 'search.action.openNewEditorFromView',
541
- title: ( localizeWithPath(
542
- 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution',
543
- 'search.openNewEditor',
544
- "Open New Search Editor"
545
- )),
546
- category,
547
- icon: searchNewEditorIcon,
548
- menu: [{
549
- id: MenuId.ViewTitle,
550
- group: 'navigation',
551
- order: 2,
552
- when: ( ContextKeyExpr.equals('view', VIEW_ID)),
553
- }]
554
- });
555
- }
556
- run(accessor, ...args) {
557
- return openSearchEditor(accessor);
558
- }
559
- });
560
- let SearchEditorWorkingCopyEditorHandler = class SearchEditorWorkingCopyEditorHandler extends Disposable {
561
- static { this.ID = 'workbench.contrib.searchEditorWorkingCopyEditorHandler'; }
562
- constructor(instantiationService, workingCopyEditorService) {
563
- super();
564
- this.instantiationService = instantiationService;
565
- this._register(workingCopyEditorService.registerHandler(this));
566
- }
567
- handles(workingCopy) {
568
- return workingCopy.resource.scheme === SearchEditorScheme;
569
- }
570
- isOpen(workingCopy, editor) {
571
- if (!this.handles(workingCopy)) {
572
- return false;
573
- }
574
- return editor instanceof SearchEditorInput && isEqual(workingCopy.resource, editor.modelUri);
575
- }
576
- createEditor(workingCopy) {
577
- const input = this.instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'model', modelUri: workingCopy.resource });
578
- input.setDirty(true);
579
- return input;
580
- }
581
- };
582
- SearchEditorWorkingCopyEditorHandler = ( __decorate([
583
- ( __param(0, IInstantiationService)),
584
- ( __param(1, IWorkingCopyEditorService))
585
- ], SearchEditorWorkingCopyEditorHandler));
586
- registerWorkbenchContribution2(SearchEditorWorkingCopyEditorHandler.ID, SearchEditorWorkingCopyEditorHandler, 2 );