@codingame/monaco-vscode-views-service-override 2.0.2 → 2.0.3
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/editors/binaryFileEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +522 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +101 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +0 -344
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution2.js +0 -105
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
6
|
+
import { workbenchConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
|
|
7
|
+
import { RegisteredEditorPriority, IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
8
|
+
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
9
|
+
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
10
|
+
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
11
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
12
|
+
import { getLargeFileConfirmationLimit, ByteSize } from 'vscode/vscode/vs/platform/files/common/files';
|
|
13
|
+
|
|
14
|
+
var DynamicEditorConfigurations_1;
|
|
15
|
+
let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disposable {
|
|
16
|
+
static { DynamicEditorConfigurations_1 = this; }
|
|
17
|
+
static { this.AUTO_LOCK_DEFAULT_ENABLED = ( new Set(['terminalEditor'])); }
|
|
18
|
+
static { this.AUTO_LOCK_EXTRA_EDITORS = [
|
|
19
|
+
{
|
|
20
|
+
id: 'workbench.input.interactive',
|
|
21
|
+
label: ( localizeWithPath(
|
|
22
|
+
'vs/workbench/browser/parts/editor/editorConfiguration',
|
|
23
|
+
'interactiveWindow',
|
|
24
|
+
'Interactive Window'
|
|
25
|
+
)),
|
|
26
|
+
priority: RegisteredEditorPriority.builtin
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'mainThreadWebview-markdown.preview',
|
|
30
|
+
label: ( localizeWithPath(
|
|
31
|
+
'vs/workbench/browser/parts/editor/editorConfiguration',
|
|
32
|
+
'markdownPreview',
|
|
33
|
+
"Markdown Preview"
|
|
34
|
+
)),
|
|
35
|
+
priority: RegisteredEditorPriority.builtin
|
|
36
|
+
}
|
|
37
|
+
]; }
|
|
38
|
+
static { this.AUTO_LOCK_REMOVE_EDITORS = ( new Set([
|
|
39
|
+
'vscode-interactive-input',
|
|
40
|
+
'interactive',
|
|
41
|
+
'vscode.markdown.preview.editor'
|
|
42
|
+
])); }
|
|
43
|
+
constructor(editorResolverService, extensionService, environmentService) {
|
|
44
|
+
super();
|
|
45
|
+
this.editorResolverService = editorResolverService;
|
|
46
|
+
this.environmentService = environmentService;
|
|
47
|
+
this.configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
48
|
+
(async () => {
|
|
49
|
+
await extensionService.whenInstalledExtensionsRegistered();
|
|
50
|
+
this.updateDynamicEditorConfigurations();
|
|
51
|
+
this.registerListeners();
|
|
52
|
+
})();
|
|
53
|
+
}
|
|
54
|
+
registerListeners() {
|
|
55
|
+
Event.debounce(this.editorResolverService.onDidChangeEditorRegistrations, (_, e) => e)(() => this.updateDynamicEditorConfigurations());
|
|
56
|
+
}
|
|
57
|
+
updateDynamicEditorConfigurations() {
|
|
58
|
+
const lockableEditors = [...this.editorResolverService.getEditors(), ...DynamicEditorConfigurations_1.AUTO_LOCK_EXTRA_EDITORS].filter(e => !( DynamicEditorConfigurations_1.AUTO_LOCK_REMOVE_EDITORS.has(e.id)));
|
|
59
|
+
const binaryEditorCandidates = ( this.editorResolverService.getEditors().filter(e => e.priority !== RegisteredEditorPriority.exclusive).map(e => e.id));
|
|
60
|
+
const autoLockGroupConfiguration = Object.create(null);
|
|
61
|
+
for (const editor of lockableEditors) {
|
|
62
|
+
autoLockGroupConfiguration[editor.id] = {
|
|
63
|
+
type: 'boolean',
|
|
64
|
+
default: ( DynamicEditorConfigurations_1.AUTO_LOCK_DEFAULT_ENABLED.has(editor.id)),
|
|
65
|
+
description: editor.label
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const defaultAutoLockGroupConfiguration = Object.create(null);
|
|
69
|
+
for (const editor of lockableEditors) {
|
|
70
|
+
defaultAutoLockGroupConfiguration[editor.id] = ( DynamicEditorConfigurations_1.AUTO_LOCK_DEFAULT_ENABLED.has(editor.id));
|
|
71
|
+
}
|
|
72
|
+
const oldAutoLockConfigurationNode = this.autoLockConfigurationNode;
|
|
73
|
+
this.autoLockConfigurationNode = {
|
|
74
|
+
...workbenchConfigurationNodeBase,
|
|
75
|
+
properties: {
|
|
76
|
+
'workbench.editor.autoLockGroups': {
|
|
77
|
+
type: 'object',
|
|
78
|
+
description: ( localizeWithPath(
|
|
79
|
+
'vs/workbench/browser/parts/editor/editorConfiguration',
|
|
80
|
+
'workbench.editor.autoLockGroups',
|
|
81
|
+
"If an editor matching one of the listed types is opened as the first in an editor group and more than one group is open, the group is automatically locked. Locked groups will only be used for opening editors when explicitly chosen by a user gesture (for example drag and drop), but not by default. Consequently, the active editor in a locked group is less likely to be replaced accidentally with a different editor."
|
|
82
|
+
)),
|
|
83
|
+
properties: autoLockGroupConfiguration,
|
|
84
|
+
default: defaultAutoLockGroupConfiguration,
|
|
85
|
+
additionalProperties: false
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const oldDefaultBinaryEditorConfigurationNode = this.defaultBinaryEditorConfigurationNode;
|
|
90
|
+
this.defaultBinaryEditorConfigurationNode = {
|
|
91
|
+
...workbenchConfigurationNodeBase,
|
|
92
|
+
properties: {
|
|
93
|
+
'workbench.editor.defaultBinaryEditor': {
|
|
94
|
+
type: 'string',
|
|
95
|
+
default: '',
|
|
96
|
+
enum: [...binaryEditorCandidates, ''],
|
|
97
|
+
description: ( localizeWithPath(
|
|
98
|
+
'vs/workbench/browser/parts/editor/editorConfiguration',
|
|
99
|
+
'workbench.editor.defaultBinaryEditor',
|
|
100
|
+
"The default editor for files detected as binary. If undefined, the user will be presented with a picker."
|
|
101
|
+
)),
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const oldEditorAssociationsConfigurationNode = this.editorAssociationsConfigurationNode;
|
|
106
|
+
this.editorAssociationsConfigurationNode = {
|
|
107
|
+
...workbenchConfigurationNodeBase,
|
|
108
|
+
properties: {
|
|
109
|
+
'workbench.editorAssociations': {
|
|
110
|
+
type: 'object',
|
|
111
|
+
markdownDescription: ( localizeWithPath(
|
|
112
|
+
'vs/workbench/browser/parts/editor/editorConfiguration',
|
|
113
|
+
'editor.editorAssociations',
|
|
114
|
+
"Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `\"*.hex\": \"hexEditor.hexedit\"`). These have precedence over the default behavior."
|
|
115
|
+
)),
|
|
116
|
+
patternProperties: {
|
|
117
|
+
'.*': {
|
|
118
|
+
type: 'string',
|
|
119
|
+
enum: binaryEditorCandidates,
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const oldEditorLargeFileConfirmationConfigurationNode = this.editorLargeFileConfirmationConfigurationNode;
|
|
126
|
+
this.editorLargeFileConfirmationConfigurationNode = {
|
|
127
|
+
...workbenchConfigurationNodeBase,
|
|
128
|
+
properties: {
|
|
129
|
+
'workbench.editorLargeFileConfirmation': {
|
|
130
|
+
type: 'number',
|
|
131
|
+
default: getLargeFileConfirmationLimit(this.environmentService.remoteAuthority) / ByteSize.MB,
|
|
132
|
+
minimum: 1,
|
|
133
|
+
scope: 4 ,
|
|
134
|
+
markdownDescription: ( localizeWithPath(
|
|
135
|
+
'vs/workbench/browser/parts/editor/editorConfiguration',
|
|
136
|
+
'editorLargeFileSizeConfirmation',
|
|
137
|
+
"Controls the minimum size of a file in MB before asking for confirmation when opening in the editor. Note that this setting may not apply to all editor types and environments."
|
|
138
|
+
)),
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
this.configurationRegistry.updateConfigurations({
|
|
143
|
+
add: [
|
|
144
|
+
this.autoLockConfigurationNode,
|
|
145
|
+
this.defaultBinaryEditorConfigurationNode,
|
|
146
|
+
this.editorAssociationsConfigurationNode,
|
|
147
|
+
this.editorLargeFileConfirmationConfigurationNode
|
|
148
|
+
],
|
|
149
|
+
remove: coalesce([
|
|
150
|
+
oldAutoLockConfigurationNode,
|
|
151
|
+
oldDefaultBinaryEditorConfigurationNode,
|
|
152
|
+
oldEditorAssociationsConfigurationNode,
|
|
153
|
+
oldEditorLargeFileConfirmationConfigurationNode
|
|
154
|
+
])
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
DynamicEditorConfigurations = DynamicEditorConfigurations_1 = ( __decorate([
|
|
159
|
+
( __param(0, IEditorResolverService)),
|
|
160
|
+
( __param(1, IExtensionService)),
|
|
161
|
+
( __param(2, IWorkbenchEnvironmentService))
|
|
162
|
+
], DynamicEditorConfigurations));
|
|
163
|
+
|
|
164
|
+
export { DynamicEditorConfigurations };
|
|
@@ -3,7 +3,7 @@ import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
|
3
3
|
import { BaseBinaryResourceEditor } from 'vscode/vscode/vs/workbench/browser/parts/editor/binaryEditor';
|
|
4
4
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
5
5
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
6
|
-
import { FileEditorInput } from '
|
|
6
|
+
import { FileEditorInput } from 'vscode/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput';
|
|
7
7
|
import { BINARY_FILE_EDITOR_ID, BINARY_TEXT_FILE_MODE } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
|
|
8
8
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
9
9
|
import { EditorResolution } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
@@ -10,7 +10,7 @@ import { AbstractTextCodeEditor } from 'vscode/vscode/vs/workbench/browser/parts
|
|
|
10
10
|
import { isTextEditorViewState, createEditorOpenError, createTooLargeFileError, DEFAULT_EDITOR_ASSOCIATION } from 'vscode/vscode/vs/workbench/common/editor';
|
|
11
11
|
import { applyTextEditorOptions } from 'vscode/vscode/vs/workbench/common/editor/editorOptions';
|
|
12
12
|
import { BinaryEditorModel } from 'vscode/vscode/vs/workbench/common/editor/binaryEditorModel';
|
|
13
|
-
import { FileEditorInput } from '
|
|
13
|
+
import { FileEditorInput } from 'vscode/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput';
|
|
14
14
|
import { TooLargeFileOperationError, ByteSize, FileOperationError, IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
15
15
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
16
16
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
@@ -12,7 +12,7 @@ import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
|
12
12
|
import { DiffEditorInput } from 'vscode/vscode/vs/workbench/common/editor/diffEditorInput';
|
|
13
13
|
import { RawContextKey, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
14
14
|
import { TextFileContentProvider } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
|
|
15
|
-
import { FileEditorInput } from '
|
|
15
|
+
import { FileEditorInput } from 'vscode/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput';
|
|
16
16
|
import { SAVE_FILE_AS_LABEL } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
|
|
17
17
|
import { Severity, INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
18
18
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|