@codingame/monaco-vscode-views-service-override 2.0.1 → 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.
- package/package.json +11 -11
- package/views.js +2 -3
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1375 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +164 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +530 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +101 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution2.js +0 -105
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { sep } from 'vscode/vscode/vs/base/common/path';
|
|
4
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
5
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
6
|
-
import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
|
|
7
|
-
import { FILE_EDITOR_INPUT_ID, BINARY_TEXT_FILE_MODE } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
|
|
8
|
-
import { TextFileEditorTracker } from './editors/textFileEditorTracker.js';
|
|
9
|
-
import { TextFileSaveErrorHandler } from './editors/textFileSaveErrorHandler.js';
|
|
10
|
-
import { FileEditorInput } from './editors/fileEditorInput.js';
|
|
11
|
-
import { BinaryFileEditor } from './editors/binaryFileEditor.js';
|
|
12
|
-
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
13
|
-
import { isWindows } from 'vscode/vscode/vs/base/common/platform';
|
|
14
|
-
import { ExplorerViewletViewsContribution } from 'vscode/vscode/vs/workbench/contrib/files/browser/explorerViewlet';
|
|
15
|
-
import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
|
|
16
|
-
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
17
|
-
import { UNDO_REDO_SOURCE } from './explorerService.js';
|
|
18
|
-
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
19
|
-
import { WorkspaceWatcher } from './workspaceWatcher.js';
|
|
20
|
-
import 'vscode/vscode/vs/editor/common/config/editorConfigurationSchema';
|
|
21
|
-
import { DirtyFilesIndicator } from '../common/dirtyFilesIndicator.js';
|
|
22
|
-
import { UndoCommand, RedoCommand } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
23
|
-
import { IUndoRedoService } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo';
|
|
24
|
-
import { IExplorerService } from 'vscode/vscode/vs/workbench/contrib/files/browser/files';
|
|
25
|
-
import { FileEditorInputSerializer, FileEditorWorkingCopyEditorHandler } from './editors/fileEditorHandler.js';
|
|
26
|
-
import { ModesRegistry } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
|
|
27
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
28
|
-
import { TextFileEditor } from './editors/textFileEditor.js';
|
|
29
|
-
|
|
30
|
-
let FileUriLabelContribution = class FileUriLabelContribution {
|
|
31
|
-
constructor(labelService) {
|
|
32
|
-
labelService.registerFormatter({
|
|
33
|
-
scheme: Schemas.file,
|
|
34
|
-
formatting: {
|
|
35
|
-
label: '${authority}${path}',
|
|
36
|
-
separator: sep,
|
|
37
|
-
tildify: !isWindows,
|
|
38
|
-
normalizeDriveLetter: isWindows,
|
|
39
|
-
authorityPrefix: sep + sep,
|
|
40
|
-
workspaceSuffix: ''
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
FileUriLabelContribution = ( __decorate([
|
|
46
|
-
( __param(0, ILabelService))
|
|
47
|
-
], FileUriLabelContribution));
|
|
48
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(TextFileEditor, TextFileEditor.ID, ( localizeWithPath(
|
|
49
|
-
'vs/workbench/contrib/files/browser/files.contribution',
|
|
50
|
-
'textFileEditor',
|
|
51
|
-
"Text File Editor"
|
|
52
|
-
))), [
|
|
53
|
-
( new SyncDescriptor(FileEditorInput))
|
|
54
|
-
]);
|
|
55
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(BinaryFileEditor, BinaryFileEditor.ID, ( localizeWithPath(
|
|
56
|
-
'vs/workbench/contrib/files/browser/files.contribution',
|
|
57
|
-
'binaryFileEditor',
|
|
58
|
-
"Binary File Editor"
|
|
59
|
-
))), [
|
|
60
|
-
( new SyncDescriptor(FileEditorInput))
|
|
61
|
-
]);
|
|
62
|
-
( Registry.as(EditorExtensions.EditorFactory)).registerFileEditorFactory({
|
|
63
|
-
typeId: FILE_EDITOR_INPUT_ID,
|
|
64
|
-
createFileEditor: (resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents, instantiationService) => {
|
|
65
|
-
return instantiationService.createInstance(FileEditorInput, resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents);
|
|
66
|
-
},
|
|
67
|
-
isFileEditor: (obj) => {
|
|
68
|
-
return obj instanceof FileEditorInput;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(FILE_EDITOR_INPUT_ID, FileEditorInputSerializer);
|
|
72
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(FileEditorWorkingCopyEditorHandler, 2 );
|
|
73
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ExplorerViewletViewsContribution, 1 );
|
|
74
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(TextFileEditorTracker, 1 );
|
|
75
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(TextFileSaveErrorHandler, 1 );
|
|
76
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(FileUriLabelContribution, 1 );
|
|
77
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceWatcher, 3 );
|
|
78
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(DirtyFilesIndicator, 1 );
|
|
79
|
-
UndoCommand.addImplementation(110, 'explorer', (accessor) => {
|
|
80
|
-
const undoRedoService = accessor.get(IUndoRedoService);
|
|
81
|
-
const explorerService = accessor.get(IExplorerService);
|
|
82
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
83
|
-
const explorerCanUndo = configurationService.getValue().explorer.enableUndo;
|
|
84
|
-
if (explorerService.hasViewFocus() && undoRedoService.canUndo(UNDO_REDO_SOURCE) && explorerCanUndo) {
|
|
85
|
-
undoRedoService.undo(UNDO_REDO_SOURCE);
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
return false;
|
|
89
|
-
});
|
|
90
|
-
RedoCommand.addImplementation(110, 'explorer', (accessor) => {
|
|
91
|
-
const undoRedoService = accessor.get(IUndoRedoService);
|
|
92
|
-
const explorerService = accessor.get(IExplorerService);
|
|
93
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
94
|
-
const explorerCanUndo = configurationService.getValue().explorer.enableUndo;
|
|
95
|
-
if (explorerService.hasViewFocus() && undoRedoService.canRedo(UNDO_REDO_SOURCE) && explorerCanUndo) {
|
|
96
|
-
undoRedoService.redo(UNDO_REDO_SOURCE);
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
return false;
|
|
100
|
-
});
|
|
101
|
-
ModesRegistry.registerLanguage({
|
|
102
|
-
id: BINARY_TEXT_FILE_MODE,
|
|
103
|
-
aliases: ['Binary'],
|
|
104
|
-
mimetypes: ['text/x-code-binary']
|
|
105
|
-
});
|