@codingame/monaco-vscode-views-service-override 2.0.2 → 2.0.3-improve-modularity.1

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.
@@ -0,0 +1,530 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { Schemas } from 'vscode/vscode/vs/base/common/network';
3
+ import { sep } from 'vscode/vscode/vs/base/common/path';
4
+ import { isWindows } from 'vscode/vscode/vs/base/common/platform';
5
+ import { UndoCommand, RedoCommand } from 'vscode/vscode/vs/editor/browser/editorExtensions';
6
+ import { ModesRegistry } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
7
+ import { localizeWithPath } from 'vscode/vscode/vs/nls';
8
+ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
9
+ import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
10
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
11
+ import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
12
+ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
13
+ import { IUndoRedoService } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo';
14
+ import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
15
+ import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
16
+ import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
17
+ import { BinaryFileEditor } from './editors/binaryFileEditor.js';
18
+ import { FileEditorInputSerializer, FileEditorWorkingCopyEditorHandler } from './editors/fileEditorHandler.js';
19
+ import { FileEditorInput } from './editors/fileEditorInput.js';
20
+ import { TextFileEditor } from './editors/textFileEditor.js';
21
+ import { TextFileEditorTracker } from './editors/textFileEditorTracker.js';
22
+ import { TextFileSaveErrorHandler } from './editors/textFileSaveErrorHandler.js';
23
+ import { UNDO_REDO_SOURCE } from './explorerService.js';
24
+ import { ExplorerViewletViewsContribution } from 'vscode/vscode/vs/workbench/contrib/files/browser/explorerViewlet';
25
+ import { IExplorerService } from 'vscode/vscode/vs/workbench/contrib/files/browser/files';
26
+ import { WorkspaceWatcher } from './workspaceWatcher.js';
27
+ import { DirtyFilesIndicator } from '../common/dirtyFilesIndicator.js';
28
+ import { FILE_EDITOR_INPUT_ID, BINARY_TEXT_FILE_MODE } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
29
+ import 'vscode/vscode/vs/workbench/contrib/files/browser/files.configuration.contribution';
30
+
31
+ let FileUriLabelContribution = class FileUriLabelContribution {
32
+ constructor(labelService) {
33
+ labelService.registerFormatter({
34
+ scheme: Schemas.file,
35
+ formatting: {
36
+ label: '${authority}${path}',
37
+ separator: sep,
38
+ tildify: !isWindows,
39
+ normalizeDriveLetter: isWindows,
40
+ authorityPrefix: sep + sep,
41
+ workspaceSuffix: ''
42
+ }
43
+ });
44
+ }
45
+ };
46
+ FileUriLabelContribution = ( __decorate([
47
+ ( __param(0, ILabelService))
48
+ ], FileUriLabelContribution));
49
+ ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(TextFileEditor, TextFileEditor.ID, ( localizeWithPath(
50
+ 'vs/workbench/contrib/files/browser/files.contribution',
51
+ 'textFileEditor',
52
+ "Text File Editor"
53
+ ))), [
54
+ ( new SyncDescriptor(FileEditorInput))
55
+ ]);
56
+ ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(BinaryFileEditor, BinaryFileEditor.ID, ( localizeWithPath(
57
+ 'vs/workbench/contrib/files/browser/files.contribution',
58
+ 'binaryFileEditor',
59
+ "Binary File Editor"
60
+ ))), [
61
+ ( new SyncDescriptor(FileEditorInput))
62
+ ]);
63
+ ( Registry.as(EditorExtensions.EditorFactory)).registerFileEditorFactory({
64
+ typeId: FILE_EDITOR_INPUT_ID,
65
+ createFileEditor: (resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents, instantiationService) => {
66
+ return instantiationService.createInstance(FileEditorInput, resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents);
67
+ },
68
+ isFileEditor: (obj) => {
69
+ return obj instanceof FileEditorInput;
70
+ }
71
+ });
72
+ ( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(FILE_EDITOR_INPUT_ID, FileEditorInputSerializer);
73
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(FileEditorWorkingCopyEditorHandler, 2 );
74
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ExplorerViewletViewsContribution, 1 );
75
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(TextFileEditorTracker, 1 );
76
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(TextFileSaveErrorHandler, 1 );
77
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(FileUriLabelContribution, 1 );
78
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceWatcher, 3 );
79
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(DirtyFilesIndicator, 1 );
80
+ const configurationRegistry = ( Registry.as(Extensions$1.Configuration));
81
+ configurationRegistry.registerConfiguration({
82
+ 'id': 'explorer',
83
+ 'order': 10,
84
+ 'title': ( localizeWithPath(
85
+ 'vs/workbench/contrib/files/browser/files.contribution',
86
+ 'explorerConfigurationTitle',
87
+ "File Explorer"
88
+ )),
89
+ 'type': 'object',
90
+ 'properties': {
91
+ 'explorer.openEditors.visible': {
92
+ 'type': 'number',
93
+ 'description': ( localizeWithPath(
94
+ 'vs/workbench/contrib/files/browser/files.contribution',
95
+ { key: 'openEditorsVisible', comment: ['Open is an adjective'] },
96
+ "The initial maximum number of editors shown in the Open Editors pane. Exceeding this limit will show a scroll bar and allow resizing the pane to display more items."
97
+ )),
98
+ 'default': 9,
99
+ 'minimum': 1
100
+ },
101
+ 'explorer.openEditors.minVisible': {
102
+ 'type': 'number',
103
+ 'description': ( localizeWithPath(
104
+ 'vs/workbench/contrib/files/browser/files.contribution',
105
+ { key: 'openEditorsVisibleMin', comment: ['Open is an adjective'] },
106
+ "The minimum number of editor slots pre-allocated in the Open Editors pane. If set to 0 the Open Editors pane will dynamically resize based on the number of editors."
107
+ )),
108
+ 'default': 0,
109
+ 'minimum': 0
110
+ },
111
+ 'explorer.openEditors.sortOrder': {
112
+ 'type': 'string',
113
+ 'enum': ['editorOrder', 'alphabetical', 'fullPath'],
114
+ 'description': ( localizeWithPath(
115
+ 'vs/workbench/contrib/files/browser/files.contribution',
116
+ { key: 'openEditorsSortOrder', comment: ['Open is an adjective'] },
117
+ "Controls the sorting order of editors in the Open Editors pane."
118
+ )),
119
+ 'enumDescriptions': [
120
+ ( localizeWithPath(
121
+ 'vs/workbench/contrib/files/browser/files.contribution',
122
+ 'sortOrder.editorOrder',
123
+ 'Editors are ordered in the same order editor tabs are shown.'
124
+ )),
125
+ ( localizeWithPath(
126
+ 'vs/workbench/contrib/files/browser/files.contribution',
127
+ 'sortOrder.alphabetical',
128
+ 'Editors are ordered alphabetically by tab name inside each editor group.'
129
+ )),
130
+ ( localizeWithPath(
131
+ 'vs/workbench/contrib/files/browser/files.contribution',
132
+ 'sortOrder.fullPath',
133
+ 'Editors are ordered alphabetically by full path inside each editor group.'
134
+ ))
135
+ ],
136
+ 'default': 'editorOrder'
137
+ },
138
+ 'explorer.autoReveal': {
139
+ 'type': ['boolean', 'string'],
140
+ 'enum': [true, false, 'focusNoScroll'],
141
+ 'default': true,
142
+ 'enumDescriptions': [
143
+ ( localizeWithPath(
144
+ 'vs/workbench/contrib/files/browser/files.contribution',
145
+ 'autoReveal.on',
146
+ 'Files will be revealed and selected.'
147
+ )),
148
+ ( localizeWithPath(
149
+ 'vs/workbench/contrib/files/browser/files.contribution',
150
+ 'autoReveal.off',
151
+ 'Files will not be revealed and selected.'
152
+ )),
153
+ ( localizeWithPath(
154
+ 'vs/workbench/contrib/files/browser/files.contribution',
155
+ 'autoReveal.focusNoScroll',
156
+ 'Files will not be scrolled into view, but will still be focused.'
157
+ )),
158
+ ],
159
+ 'description': ( localizeWithPath(
160
+ 'vs/workbench/contrib/files/browser/files.contribution',
161
+ 'autoReveal',
162
+ "Controls whether the Explorer should automatically reveal and select files when opening them."
163
+ ))
164
+ },
165
+ 'explorer.autoRevealExclude': {
166
+ 'type': 'object',
167
+ 'markdownDescription': ( localizeWithPath(
168
+ 'vs/workbench/contrib/files/browser/files.contribution',
169
+ 'autoRevealExclude',
170
+ "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders from being revealed and selected in the Explorer when they are opened. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths."
171
+ )),
172
+ 'default': { '**/node_modules': true, '**/bower_components': true },
173
+ 'additionalProperties': {
174
+ 'anyOf': [
175
+ {
176
+ 'type': 'boolean',
177
+ 'description': ( localizeWithPath(
178
+ 'vs/workbench/contrib/files/browser/files.contribution',
179
+ 'explorer.autoRevealExclude.boolean',
180
+ "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."
181
+ )),
182
+ },
183
+ {
184
+ type: 'object',
185
+ properties: {
186
+ when: {
187
+ type: 'string',
188
+ pattern: '\\w*\\$\\(basename\\)\\w*',
189
+ default: '$(basename).ext',
190
+ description: ( localizeWithPath(
191
+ 'vs/workbench/contrib/files/browser/files.contribution',
192
+ 'explorer.autoRevealExclude.when',
193
+ 'Additional check on the siblings of a matching file. Use $(basename) as variable for the matching file name.'
194
+ ))
195
+ }
196
+ }
197
+ }
198
+ ]
199
+ }
200
+ },
201
+ 'explorer.enableDragAndDrop': {
202
+ 'type': 'boolean',
203
+ 'description': ( localizeWithPath(
204
+ 'vs/workbench/contrib/files/browser/files.contribution',
205
+ 'enableDragAndDrop',
206
+ "Controls whether the Explorer should allow to move files and folders via drag and drop. This setting only effects drag and drop from inside the Explorer."
207
+ )),
208
+ 'default': true
209
+ },
210
+ 'explorer.confirmDragAndDrop': {
211
+ 'type': 'boolean',
212
+ 'description': ( localizeWithPath(
213
+ 'vs/workbench/contrib/files/browser/files.contribution',
214
+ 'confirmDragAndDrop',
215
+ "Controls whether the Explorer should ask for confirmation to move files and folders via drag and drop."
216
+ )),
217
+ 'default': true
218
+ },
219
+ 'explorer.confirmPasteNative': {
220
+ 'type': 'boolean',
221
+ 'description': ( localizeWithPath(
222
+ 'vs/workbench/contrib/files/browser/files.contribution',
223
+ 'confirmPasteNative',
224
+ "Controls whether the Explorer should ask for confirmation when pasting native files and folders."
225
+ )),
226
+ 'default': true
227
+ },
228
+ 'explorer.confirmDelete': {
229
+ 'type': 'boolean',
230
+ 'description': ( localizeWithPath(
231
+ 'vs/workbench/contrib/files/browser/files.contribution',
232
+ 'confirmDelete',
233
+ "Controls whether the Explorer should ask for confirmation when deleting a file via the trash."
234
+ )),
235
+ 'default': true
236
+ },
237
+ 'explorer.enableUndo': {
238
+ 'type': 'boolean',
239
+ 'description': ( localizeWithPath(
240
+ 'vs/workbench/contrib/files/browser/files.contribution',
241
+ 'enableUndo',
242
+ "Controls whether the Explorer should support undoing file and folder operations."
243
+ )),
244
+ 'default': true
245
+ },
246
+ 'explorer.confirmUndo': {
247
+ 'type': 'string',
248
+ 'enum': ["verbose" , "default" , "light" ],
249
+ 'description': ( localizeWithPath(
250
+ 'vs/workbench/contrib/files/browser/files.contribution',
251
+ 'confirmUndo',
252
+ "Controls whether the Explorer should ask for confirmation when undoing."
253
+ )),
254
+ 'default': "default" ,
255
+ 'enumDescriptions': [
256
+ ( localizeWithPath(
257
+ 'vs/workbench/contrib/files/browser/files.contribution',
258
+ 'enableUndo.verbose',
259
+ 'Explorer will prompt before all undo operations.'
260
+ )),
261
+ ( localizeWithPath(
262
+ 'vs/workbench/contrib/files/browser/files.contribution',
263
+ 'enableUndo.default',
264
+ 'Explorer will prompt before destructive undo operations.'
265
+ )),
266
+ ( localizeWithPath(
267
+ 'vs/workbench/contrib/files/browser/files.contribution',
268
+ 'enableUndo.light',
269
+ 'Explorer will not prompt before undo operations when focused.'
270
+ )),
271
+ ],
272
+ },
273
+ 'explorer.expandSingleFolderWorkspaces': {
274
+ 'type': 'boolean',
275
+ 'description': ( localizeWithPath(
276
+ 'vs/workbench/contrib/files/browser/files.contribution',
277
+ 'expandSingleFolderWorkspaces',
278
+ "Controls whether the Explorer should expand multi-root workspaces containing only one folder during initialization"
279
+ )),
280
+ 'default': true
281
+ },
282
+ 'explorer.sortOrder': {
283
+ 'type': 'string',
284
+ 'enum': ["default" , "mixed" , "filesFirst" , "type" , "modified" , "foldersNestsFiles" ],
285
+ 'default': "default" ,
286
+ 'enumDescriptions': [
287
+ ( localizeWithPath(
288
+ 'vs/workbench/contrib/files/browser/files.contribution',
289
+ 'sortOrder.default',
290
+ 'Files and folders are sorted by their names. Folders are displayed before files.'
291
+ )),
292
+ ( localizeWithPath(
293
+ 'vs/workbench/contrib/files/browser/files.contribution',
294
+ 'sortOrder.mixed',
295
+ 'Files and folders are sorted by their names. Files are interwoven with folders.'
296
+ )),
297
+ ( localizeWithPath(
298
+ 'vs/workbench/contrib/files/browser/files.contribution',
299
+ 'sortOrder.filesFirst',
300
+ 'Files and folders are sorted by their names. Files are displayed before folders.'
301
+ )),
302
+ ( localizeWithPath(
303
+ 'vs/workbench/contrib/files/browser/files.contribution',
304
+ 'sortOrder.type',
305
+ 'Files and folders are grouped by extension type then sorted by their names. Folders are displayed before files.'
306
+ )),
307
+ ( localizeWithPath(
308
+ 'vs/workbench/contrib/files/browser/files.contribution',
309
+ 'sortOrder.modified',
310
+ 'Files and folders are sorted by last modified date in descending order. Folders are displayed before files.'
311
+ )),
312
+ ( localizeWithPath(
313
+ 'vs/workbench/contrib/files/browser/files.contribution',
314
+ 'sortOrder.foldersNestsFiles',
315
+ 'Files and folders are sorted by their names. Folders are displayed before files. Files with nested children are displayed before other files.'
316
+ ))
317
+ ],
318
+ 'markdownDescription': ( localizeWithPath(
319
+ 'vs/workbench/contrib/files/browser/files.contribution',
320
+ 'sortOrder',
321
+ "Controls the property-based sorting of files and folders in the Explorer. When `#explorer.fileNesting.enabled#` is enabled, also controls sorting of nested files."
322
+ ))
323
+ },
324
+ 'explorer.sortOrderLexicographicOptions': {
325
+ 'type': 'string',
326
+ 'enum': ["default" , "upper" , "lower" , "unicode" ],
327
+ 'default': "default" ,
328
+ 'enumDescriptions': [
329
+ ( localizeWithPath(
330
+ 'vs/workbench/contrib/files/browser/files.contribution',
331
+ 'sortOrderLexicographicOptions.default',
332
+ 'Uppercase and lowercase names are mixed together.'
333
+ )),
334
+ ( localizeWithPath(
335
+ 'vs/workbench/contrib/files/browser/files.contribution',
336
+ 'sortOrderLexicographicOptions.upper',
337
+ 'Uppercase names are grouped together before lowercase names.'
338
+ )),
339
+ ( localizeWithPath(
340
+ 'vs/workbench/contrib/files/browser/files.contribution',
341
+ 'sortOrderLexicographicOptions.lower',
342
+ 'Lowercase names are grouped together before uppercase names.'
343
+ )),
344
+ ( localizeWithPath(
345
+ 'vs/workbench/contrib/files/browser/files.contribution',
346
+ 'sortOrderLexicographicOptions.unicode',
347
+ 'Names are sorted in Unicode order.'
348
+ ))
349
+ ],
350
+ 'description': ( localizeWithPath(
351
+ 'vs/workbench/contrib/files/browser/files.contribution',
352
+ 'sortOrderLexicographicOptions',
353
+ "Controls the lexicographic sorting of file and folder names in the Explorer."
354
+ ))
355
+ },
356
+ 'explorer.decorations.colors': {
357
+ type: 'boolean',
358
+ description: ( localizeWithPath(
359
+ 'vs/workbench/contrib/files/browser/files.contribution',
360
+ 'explorer.decorations.colors',
361
+ "Controls whether file decorations should use colors."
362
+ )),
363
+ default: true
364
+ },
365
+ 'explorer.decorations.badges': {
366
+ type: 'boolean',
367
+ description: ( localizeWithPath(
368
+ 'vs/workbench/contrib/files/browser/files.contribution',
369
+ 'explorer.decorations.badges',
370
+ "Controls whether file decorations should use badges."
371
+ )),
372
+ default: true
373
+ },
374
+ 'explorer.incrementalNaming': {
375
+ 'type': 'string',
376
+ enum: ['simple', 'smart', 'disabled'],
377
+ enumDescriptions: [
378
+ ( localizeWithPath(
379
+ 'vs/workbench/contrib/files/browser/files.contribution',
380
+ 'simple',
381
+ "Appends the word \"copy\" at the end of the duplicated name potentially followed by a number."
382
+ )),
383
+ ( localizeWithPath(
384
+ 'vs/workbench/contrib/files/browser/files.contribution',
385
+ 'smart',
386
+ "Adds a number at the end of the duplicated name. If some number is already part of the name, tries to increase that number."
387
+ )),
388
+ ( localizeWithPath(
389
+ 'vs/workbench/contrib/files/browser/files.contribution',
390
+ 'disabled',
391
+ "Disables incremental naming. If two files with the same name exist you will be prompted to overwrite the existing file."
392
+ ))
393
+ ],
394
+ description: ( localizeWithPath(
395
+ 'vs/workbench/contrib/files/browser/files.contribution',
396
+ 'explorer.incrementalNaming',
397
+ "Controls which naming strategy to use when giving a new name to a duplicated Explorer item on paste."
398
+ )),
399
+ default: 'simple'
400
+ },
401
+ 'explorer.compactFolders': {
402
+ 'type': 'boolean',
403
+ 'description': ( localizeWithPath(
404
+ 'vs/workbench/contrib/files/browser/files.contribution',
405
+ 'compressSingleChildFolders',
406
+ "Controls whether the Explorer should render folders in a compact form. In such a form, single child folders will be compressed in a combined tree element. Useful for Java package structures, for example."
407
+ )),
408
+ 'default': true
409
+ },
410
+ 'explorer.copyRelativePathSeparator': {
411
+ 'type': 'string',
412
+ 'enum': [
413
+ '/',
414
+ '\\',
415
+ 'auto'
416
+ ],
417
+ 'enumDescriptions': [
418
+ ( localizeWithPath(
419
+ 'vs/workbench/contrib/files/browser/files.contribution',
420
+ 'copyRelativePathSeparator.slash',
421
+ "Use slash as path separation character."
422
+ )),
423
+ ( localizeWithPath(
424
+ 'vs/workbench/contrib/files/browser/files.contribution',
425
+ 'copyRelativePathSeparator.backslash',
426
+ "Use backslash as path separation character."
427
+ )),
428
+ ( localizeWithPath(
429
+ 'vs/workbench/contrib/files/browser/files.contribution',
430
+ 'copyRelativePathSeparator.auto',
431
+ "Uses operating system specific path separation character."
432
+ )),
433
+ ],
434
+ 'description': ( localizeWithPath(
435
+ 'vs/workbench/contrib/files/browser/files.contribution',
436
+ 'copyRelativePathSeparator',
437
+ "The path separation character used when copying relative file paths."
438
+ )),
439
+ 'default': 'auto'
440
+ },
441
+ 'explorer.excludeGitIgnore': {
442
+ type: 'boolean',
443
+ markdownDescription: ( localizeWithPath(
444
+ 'vs/workbench/contrib/files/browser/files.contribution',
445
+ 'excludeGitignore',
446
+ "Controls whether entries in .gitignore should be parsed and excluded from the Explorer. Similar to {0}.",
447
+ '`#files.exclude#`'
448
+ )),
449
+ default: false,
450
+ scope: 4
451
+ },
452
+ 'explorer.fileNesting.enabled': {
453
+ 'type': 'boolean',
454
+ scope: 4 ,
455
+ 'markdownDescription': ( localizeWithPath(
456
+ 'vs/workbench/contrib/files/browser/files.contribution',
457
+ 'fileNestingEnabled',
458
+ "Controls whether file nesting is enabled in the Explorer. File nesting allows for related files in a directory to be visually grouped together under a single parent file."
459
+ )),
460
+ 'default': false,
461
+ },
462
+ 'explorer.fileNesting.expand': {
463
+ 'type': 'boolean',
464
+ 'markdownDescription': ( localizeWithPath(
465
+ 'vs/workbench/contrib/files/browser/files.contribution',
466
+ 'fileNestingExpand',
467
+ "Controls whether file nests are automatically expanded. {0} must be set for this to take effect.",
468
+ '`#explorer.fileNesting.enabled#`'
469
+ )),
470
+ 'default': true,
471
+ },
472
+ 'explorer.fileNesting.patterns': {
473
+ 'type': 'object',
474
+ scope: 4 ,
475
+ 'markdownDescription': ( localizeWithPath(
476
+ 'vs/workbench/contrib/files/browser/files.contribution',
477
+ 'fileNestingPatterns',
478
+ "Controls nesting of files in the Explorer. {0} must be set for this to take effect. Each __Item__ represents a parent pattern and may contain a single `*` character that matches any string. Each __Value__ represents a comma separated list of the child patterns that should be shown nested under a given parent. Child patterns may contain several special tokens:\n- `${capture}`: Matches the resolved value of the `*` from the parent pattern\n- `${basename}`: Matches the parent file's basename, the `file` in `file.ts`\n- `${extname}`: Matches the parent file's extension, the `ts` in `file.ts`\n- `${dirname}`: Matches the parent file's directory name, the `src` in `src/file.ts`\n- `*`: Matches any string, may only be used once per child pattern",
479
+ '`#explorer.fileNesting.enabled#`'
480
+ )),
481
+ patternProperties: {
482
+ '^[^*]*\\*?[^*]*$': {
483
+ markdownDescription: ( localizeWithPath(
484
+ 'vs/workbench/contrib/files/browser/files.contribution',
485
+ 'fileNesting.description',
486
+ "Each key pattern may contain a single `*` character which will match any string."
487
+ )),
488
+ type: 'string',
489
+ pattern: '^([^,*]*\\*?[^,*]*)(, ?[^,*]*\\*?[^,*]*)*$',
490
+ }
491
+ },
492
+ additionalProperties: false,
493
+ 'default': {
494
+ '*.ts': '${capture}.js',
495
+ '*.js': '${capture}.js.map, ${capture}.min.js, ${capture}.d.ts',
496
+ '*.jsx': '${capture}.js',
497
+ '*.tsx': '${capture}.ts',
498
+ 'tsconfig.json': 'tsconfig.*.json',
499
+ 'package.json': 'package-lock.json, yarn.lock, pnpm-lock.yaml',
500
+ }
501
+ }
502
+ }
503
+ });
504
+ UndoCommand.addImplementation(110, 'explorer', (accessor) => {
505
+ const undoRedoService = accessor.get(IUndoRedoService);
506
+ const explorerService = accessor.get(IExplorerService);
507
+ const configurationService = accessor.get(IConfigurationService);
508
+ const explorerCanUndo = configurationService.getValue().explorer.enableUndo;
509
+ if (explorerService.hasViewFocus() && undoRedoService.canUndo(UNDO_REDO_SOURCE) && explorerCanUndo) {
510
+ undoRedoService.undo(UNDO_REDO_SOURCE);
511
+ return true;
512
+ }
513
+ return false;
514
+ });
515
+ RedoCommand.addImplementation(110, 'explorer', (accessor) => {
516
+ const undoRedoService = accessor.get(IUndoRedoService);
517
+ const explorerService = accessor.get(IExplorerService);
518
+ const configurationService = accessor.get(IConfigurationService);
519
+ const explorerCanUndo = configurationService.getValue().explorer.enableUndo;
520
+ if (explorerService.hasViewFocus() && undoRedoService.canRedo(UNDO_REDO_SOURCE) && explorerCanUndo) {
521
+ undoRedoService.redo(UNDO_REDO_SOURCE);
522
+ return true;
523
+ }
524
+ return false;
525
+ });
526
+ ModesRegistry.registerLanguage({
527
+ id: BINARY_TEXT_FILE_MODE,
528
+ aliases: ['Binary'],
529
+ mimetypes: ['text/x-code-binary']
530
+ });
@@ -0,0 +1,101 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { Schemas } from 'vscode/vscode/vs/base/common/network';
3
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
+ import { URI } from 'vscode/vscode/vs/base/common/uri';
5
+ import { ITextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService';
6
+ import { toLocalResource, isEqual } from 'vscode/vscode/vs/base/common/resources';
7
+ import { PLAINTEXT_LANGUAGE_ID } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
8
+ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
9
+ import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
10
+ import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService';
11
+ import { UntitledTextEditorInput } from 'vscode/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput';
12
+ import { NO_TYPE_ID } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopy';
13
+ import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService';
14
+ import { IUntitledTextEditorService } from 'vscode/vscode/vs/workbench/services/untitled/common/untitledTextEditorService';
15
+
16
+ let UntitledTextEditorInputSerializer = class UntitledTextEditorInputSerializer {
17
+ constructor(filesConfigurationService, environmentService, pathService) {
18
+ this.filesConfigurationService = filesConfigurationService;
19
+ this.environmentService = environmentService;
20
+ this.pathService = pathService;
21
+ }
22
+ canSerialize(editorInput) {
23
+ return this.filesConfigurationService.isHotExitEnabled && !editorInput.isDisposed();
24
+ }
25
+ serialize(editorInput) {
26
+ if (!this.filesConfigurationService.isHotExitEnabled || editorInput.isDisposed()) {
27
+ return undefined;
28
+ }
29
+ const untitledTextEditorInput = editorInput;
30
+ let resource = untitledTextEditorInput.resource;
31
+ if (untitledTextEditorInput.model.hasAssociatedFilePath) {
32
+ resource = toLocalResource(resource, this.environmentService.remoteAuthority, this.pathService.defaultUriScheme);
33
+ }
34
+ let languageId;
35
+ const languageIdCandidate = untitledTextEditorInput.getLanguageId();
36
+ if (languageIdCandidate !== PLAINTEXT_LANGUAGE_ID) {
37
+ languageId = languageIdCandidate;
38
+ }
39
+ else if (untitledTextEditorInput.model.hasLanguageSetExplicitly) {
40
+ languageId = languageIdCandidate;
41
+ }
42
+ const serialized = {
43
+ resourceJSON: resource.toJSON(),
44
+ modeId: languageId,
45
+ encoding: untitledTextEditorInput.getEncoding()
46
+ };
47
+ return JSON.stringify(serialized);
48
+ }
49
+ deserialize(instantiationService, serializedEditorInput) {
50
+ return instantiationService.invokeFunction(accessor => {
51
+ const deserialized = JSON.parse(serializedEditorInput);
52
+ const resource = URI.revive(deserialized.resourceJSON);
53
+ const languageId = deserialized.modeId;
54
+ const encoding = deserialized.encoding;
55
+ return accessor.get(ITextEditorService).createTextEditor({ resource, languageId, encoding, forceUntitled: true });
56
+ });
57
+ }
58
+ };
59
+ UntitledTextEditorInputSerializer = ( __decorate([
60
+ ( __param(0, IFilesConfigurationService)),
61
+ ( __param(1, IWorkbenchEnvironmentService)),
62
+ ( __param(2, IPathService))
63
+ ], UntitledTextEditorInputSerializer));
64
+ let UntitledTextEditorWorkingCopyEditorHandler = class UntitledTextEditorWorkingCopyEditorHandler extends Disposable {
65
+ constructor(workingCopyEditorService, environmentService, pathService, textEditorService, untitledTextEditorService) {
66
+ super();
67
+ this.environmentService = environmentService;
68
+ this.pathService = pathService;
69
+ this.textEditorService = textEditorService;
70
+ this.untitledTextEditorService = untitledTextEditorService;
71
+ this._register(workingCopyEditorService.registerHandler(this));
72
+ }
73
+ handles(workingCopy) {
74
+ return workingCopy.resource.scheme === Schemas.untitled && workingCopy.typeId === NO_TYPE_ID;
75
+ }
76
+ isOpen(workingCopy, editor) {
77
+ if (!this.handles(workingCopy)) {
78
+ return false;
79
+ }
80
+ return editor instanceof UntitledTextEditorInput && isEqual(workingCopy.resource, editor.resource);
81
+ }
82
+ createEditor(workingCopy) {
83
+ let editorInputResource;
84
+ if (this.untitledTextEditorService.isUntitledWithAssociatedResource(workingCopy.resource)) {
85
+ editorInputResource = toLocalResource(workingCopy.resource, this.environmentService.remoteAuthority, this.pathService.defaultUriScheme);
86
+ }
87
+ else {
88
+ editorInputResource = workingCopy.resource;
89
+ }
90
+ return this.textEditorService.createTextEditor({ resource: editorInputResource, forceUntitled: true });
91
+ }
92
+ };
93
+ UntitledTextEditorWorkingCopyEditorHandler = ( __decorate([
94
+ ( __param(0, IWorkingCopyEditorService)),
95
+ ( __param(1, IWorkbenchEnvironmentService)),
96
+ ( __param(2, IPathService)),
97
+ ( __param(3, ITextEditorService)),
98
+ ( __param(4, IUntitledTextEditorService))
99
+ ], UntitledTextEditorWorkingCopyEditorHandler));
100
+
101
+ export { UntitledTextEditorInputSerializer, UntitledTextEditorWorkingCopyEditorHandler };