@codingame/monaco-vscode-api 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 +8 -8
- package/vscode/src/vs/workbench/browser/parts/editor/editor.autosave.contribution.js +4 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +342 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.configuration.contribution.js +463 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.fileEditorFactory.contribution.js +13 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +0 -1375
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +0 -162
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -885
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +0 -99
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { isWeb, isNative } from '../../../../base/common/platform.js';
|
|
2
|
+
import { editorConfigurationBaseNode } from '../../../../editor/common/config/editorConfigurationSchema.js';
|
|
3
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
4
|
+
import { Extensions } from '../../../../platform/configuration/common/configurationRegistry.js';
|
|
5
|
+
import { FILES_EXCLUDE_CONFIG, FILES_ASSOCIATIONS_CONFIG, AutoSaveConfiguration, FILES_READONLY_INCLUDE_CONFIG, FILES_READONLY_EXCLUDE_CONFIG, FILES_READONLY_FROM_PERMISSIONS_CONFIG, HotExitConfiguration } from '../../../../platform/files/common/files.js';
|
|
6
|
+
import { Registry } from '../../../../platform/registry/common/platform.js';
|
|
7
|
+
import { SUPPORTED_ENCODINGS } from '../../../services/textfile/common/encoding.js';
|
|
8
|
+
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
9
|
+
const hotExitConfiguration = isNative ?
|
|
10
|
+
{
|
|
11
|
+
'type': 'string',
|
|
12
|
+
'scope': 1 ,
|
|
13
|
+
'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE],
|
|
14
|
+
'default': HotExitConfiguration.ON_EXIT,
|
|
15
|
+
'markdownEnumDescriptions': [
|
|
16
|
+
( localizeWithPath(
|
|
17
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
18
|
+
'hotExit.off',
|
|
19
|
+
'Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes.'
|
|
20
|
+
)),
|
|
21
|
+
( localizeWithPath(
|
|
22
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
23
|
+
'hotExit.onExit',
|
|
24
|
+
'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`'
|
|
25
|
+
)),
|
|
26
|
+
( localizeWithPath(
|
|
27
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
28
|
+
'hotExit.onExitAndWindowClose',
|
|
29
|
+
'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it\'s the last window. All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`'
|
|
30
|
+
))
|
|
31
|
+
],
|
|
32
|
+
'markdownDescription': ( localizeWithPath(
|
|
33
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
34
|
+
'hotExit',
|
|
35
|
+
"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",
|
|
36
|
+
HotExitConfiguration.ON_EXIT,
|
|
37
|
+
HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE
|
|
38
|
+
))
|
|
39
|
+
} : {
|
|
40
|
+
'type': 'string',
|
|
41
|
+
'scope': 1 ,
|
|
42
|
+
'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE],
|
|
43
|
+
'default': HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE,
|
|
44
|
+
'markdownEnumDescriptions': [
|
|
45
|
+
( localizeWithPath(
|
|
46
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
47
|
+
'hotExit.off',
|
|
48
|
+
'Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes.'
|
|
49
|
+
)),
|
|
50
|
+
( localizeWithPath(
|
|
51
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
52
|
+
'hotExit.onExitAndWindowCloseBrowser',
|
|
53
|
+
'Hot exit will be triggered when the browser quits or the window or tab is closed.'
|
|
54
|
+
))
|
|
55
|
+
],
|
|
56
|
+
'markdownDescription': ( localizeWithPath(
|
|
57
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
58
|
+
'hotExit',
|
|
59
|
+
"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",
|
|
60
|
+
HotExitConfiguration.ON_EXIT,
|
|
61
|
+
HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE
|
|
62
|
+
))
|
|
63
|
+
};
|
|
64
|
+
configurationRegistry.registerConfiguration({
|
|
65
|
+
'id': 'files',
|
|
66
|
+
'order': 9,
|
|
67
|
+
'title': ( localizeWithPath(
|
|
68
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
69
|
+
'filesConfigurationTitle',
|
|
70
|
+
"Files"
|
|
71
|
+
)),
|
|
72
|
+
'type': 'object',
|
|
73
|
+
'properties': {
|
|
74
|
+
[FILES_EXCLUDE_CONFIG]: {
|
|
75
|
+
'type': 'object',
|
|
76
|
+
'markdownDescription': ( localizeWithPath(
|
|
77
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
78
|
+
'exclude',
|
|
79
|
+
"Configure [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search-specific excludes. Refer to the `#explorer.excludeGitIgnore#` setting for ignoring files based on your `.gitignore`."
|
|
80
|
+
)),
|
|
81
|
+
'default': {
|
|
82
|
+
...{ '**/.git': true, '**/.svn': true, '**/.hg': true, '**/CVS': true, '**/.DS_Store': true, '**/Thumbs.db': true },
|
|
83
|
+
...(isWeb ? { '**/*.crswap': true } : undefined)
|
|
84
|
+
},
|
|
85
|
+
'scope': 4 ,
|
|
86
|
+
'additionalProperties': {
|
|
87
|
+
'anyOf': [
|
|
88
|
+
{
|
|
89
|
+
'type': 'boolean',
|
|
90
|
+
'enum': [true, false],
|
|
91
|
+
'enumDescriptions': [( localizeWithPath(
|
|
92
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
93
|
+
'trueDescription',
|
|
94
|
+
"Enable the pattern."
|
|
95
|
+
)), ( localizeWithPath(
|
|
96
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
97
|
+
'falseDescription',
|
|
98
|
+
"Disable the pattern."
|
|
99
|
+
))],
|
|
100
|
+
'description': ( localizeWithPath(
|
|
101
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
102
|
+
'files.exclude.boolean',
|
|
103
|
+
"The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."
|
|
104
|
+
)),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
'type': 'object',
|
|
108
|
+
'properties': {
|
|
109
|
+
'when': {
|
|
110
|
+
'type': 'string',
|
|
111
|
+
'pattern': '\\w*\\$\\(basename\\)\\w*',
|
|
112
|
+
'default': '$(basename).ext',
|
|
113
|
+
'markdownDescription': ( localizeWithPath(
|
|
114
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
115
|
+
{ key: 'files.exclude.when', comment: ['\\$(basename) should not be translated'] },
|
|
116
|
+
"Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name."
|
|
117
|
+
))
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
[FILES_ASSOCIATIONS_CONFIG]: {
|
|
125
|
+
'type': 'object',
|
|
126
|
+
'markdownDescription': ( localizeWithPath(
|
|
127
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
128
|
+
'associations',
|
|
129
|
+
"Configure [glob patterns](https://aka.ms/vscode-glob-patterns) of file associations to languages (for example `\"*.extension\": \"html\"`). Patterns will match on the absolute path of a file if they contain a path separator and will match on the name of the file otherwise. These have precedence over the default associations of the languages installed."
|
|
130
|
+
)),
|
|
131
|
+
'additionalProperties': {
|
|
132
|
+
'type': 'string'
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
'files.encoding': {
|
|
136
|
+
'type': 'string',
|
|
137
|
+
'enum': ( Object.keys(SUPPORTED_ENCODINGS)),
|
|
138
|
+
'default': 'utf8',
|
|
139
|
+
'description': ( localizeWithPath(
|
|
140
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
141
|
+
'encoding',
|
|
142
|
+
"The default character set encoding to use when reading and writing files. This setting can also be configured per language."
|
|
143
|
+
)),
|
|
144
|
+
'scope': 5 ,
|
|
145
|
+
'enumDescriptions': ( ( Object.keys(SUPPORTED_ENCODINGS)).map(key => SUPPORTED_ENCODINGS[key].labelLong)),
|
|
146
|
+
'enumItemLabels': ( ( Object.keys(SUPPORTED_ENCODINGS)).map(key => SUPPORTED_ENCODINGS[key].labelLong))
|
|
147
|
+
},
|
|
148
|
+
'files.autoGuessEncoding': {
|
|
149
|
+
'type': 'boolean',
|
|
150
|
+
'default': false,
|
|
151
|
+
'markdownDescription': ( localizeWithPath(
|
|
152
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
153
|
+
'autoGuessEncoding',
|
|
154
|
+
"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only {0} is respected.",
|
|
155
|
+
'`#files.encoding#`'
|
|
156
|
+
)),
|
|
157
|
+
'scope': 5
|
|
158
|
+
},
|
|
159
|
+
'files.eol': {
|
|
160
|
+
'type': 'string',
|
|
161
|
+
'enum': [
|
|
162
|
+
'\n',
|
|
163
|
+
'\r\n',
|
|
164
|
+
'auto'
|
|
165
|
+
],
|
|
166
|
+
'enumDescriptions': [
|
|
167
|
+
( localizeWithPath(
|
|
168
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
169
|
+
'eol.LF',
|
|
170
|
+
"LF"
|
|
171
|
+
)),
|
|
172
|
+
( localizeWithPath(
|
|
173
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
174
|
+
'eol.CRLF',
|
|
175
|
+
"CRLF"
|
|
176
|
+
)),
|
|
177
|
+
( localizeWithPath(
|
|
178
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
179
|
+
'eol.auto',
|
|
180
|
+
"Uses operating system specific end of line character."
|
|
181
|
+
))
|
|
182
|
+
],
|
|
183
|
+
'default': 'auto',
|
|
184
|
+
'description': ( localizeWithPath(
|
|
185
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
186
|
+
'eol',
|
|
187
|
+
"The default end of line character."
|
|
188
|
+
)),
|
|
189
|
+
'scope': 5
|
|
190
|
+
},
|
|
191
|
+
'files.enableTrash': {
|
|
192
|
+
'type': 'boolean',
|
|
193
|
+
'default': true,
|
|
194
|
+
'description': ( localizeWithPath(
|
|
195
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
196
|
+
'useTrash',
|
|
197
|
+
"Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently."
|
|
198
|
+
))
|
|
199
|
+
},
|
|
200
|
+
'files.trimTrailingWhitespace': {
|
|
201
|
+
'type': 'boolean',
|
|
202
|
+
'default': false,
|
|
203
|
+
'description': ( localizeWithPath(
|
|
204
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
205
|
+
'trimTrailingWhitespace',
|
|
206
|
+
"When enabled, will trim trailing whitespace when saving a file."
|
|
207
|
+
)),
|
|
208
|
+
'scope': 5
|
|
209
|
+
},
|
|
210
|
+
'files.insertFinalNewline': {
|
|
211
|
+
'type': 'boolean',
|
|
212
|
+
'default': false,
|
|
213
|
+
'description': ( localizeWithPath(
|
|
214
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
215
|
+
'insertFinalNewline',
|
|
216
|
+
"When enabled, insert a final new line at the end of the file when saving it."
|
|
217
|
+
)),
|
|
218
|
+
'scope': 5
|
|
219
|
+
},
|
|
220
|
+
'files.trimFinalNewlines': {
|
|
221
|
+
'type': 'boolean',
|
|
222
|
+
'default': false,
|
|
223
|
+
'description': ( localizeWithPath(
|
|
224
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
225
|
+
'trimFinalNewlines',
|
|
226
|
+
"When enabled, will trim all new lines after the final new line at the end of the file when saving it."
|
|
227
|
+
)),
|
|
228
|
+
scope: 5 ,
|
|
229
|
+
},
|
|
230
|
+
'files.autoSave': {
|
|
231
|
+
'type': 'string',
|
|
232
|
+
'enum': [AutoSaveConfiguration.OFF, AutoSaveConfiguration.AFTER_DELAY, AutoSaveConfiguration.ON_FOCUS_CHANGE, AutoSaveConfiguration.ON_WINDOW_CHANGE],
|
|
233
|
+
'markdownEnumDescriptions': [
|
|
234
|
+
( localizeWithPath(
|
|
235
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
236
|
+
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.off' },
|
|
237
|
+
"An editor with changes is never automatically saved."
|
|
238
|
+
)),
|
|
239
|
+
( localizeWithPath(
|
|
240
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
241
|
+
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.afterDelay' },
|
|
242
|
+
"An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."
|
|
243
|
+
)),
|
|
244
|
+
( localizeWithPath(
|
|
245
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
246
|
+
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.onFocusChange' },
|
|
247
|
+
"An editor with changes is automatically saved when the editor loses focus."
|
|
248
|
+
)),
|
|
249
|
+
( localizeWithPath(
|
|
250
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
251
|
+
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.onWindowChange' },
|
|
252
|
+
"An editor with changes is automatically saved when the window loses focus."
|
|
253
|
+
))
|
|
254
|
+
],
|
|
255
|
+
'default': isWeb ? AutoSaveConfiguration.AFTER_DELAY : AutoSaveConfiguration.OFF,
|
|
256
|
+
'markdownDescription': ( localizeWithPath(
|
|
257
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
258
|
+
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'autoSave' },
|
|
259
|
+
"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",
|
|
260
|
+
AutoSaveConfiguration.OFF,
|
|
261
|
+
AutoSaveConfiguration.AFTER_DELAY,
|
|
262
|
+
AutoSaveConfiguration.ON_FOCUS_CHANGE,
|
|
263
|
+
AutoSaveConfiguration.ON_WINDOW_CHANGE,
|
|
264
|
+
AutoSaveConfiguration.AFTER_DELAY
|
|
265
|
+
))
|
|
266
|
+
},
|
|
267
|
+
'files.autoSaveDelay': {
|
|
268
|
+
'type': 'number',
|
|
269
|
+
'default': 1000,
|
|
270
|
+
'minimum': 0,
|
|
271
|
+
'markdownDescription': ( localizeWithPath(
|
|
272
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
273
|
+
{ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'autoSaveDelay' },
|
|
274
|
+
"Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.",
|
|
275
|
+
AutoSaveConfiguration.AFTER_DELAY
|
|
276
|
+
))
|
|
277
|
+
},
|
|
278
|
+
'files.watcherExclude': {
|
|
279
|
+
'type': 'object',
|
|
280
|
+
'patternProperties': {
|
|
281
|
+
'.*': { 'type': 'boolean' }
|
|
282
|
+
},
|
|
283
|
+
'default': { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/node_modules/*/**': true, '**/.hg/store/**': true },
|
|
284
|
+
'markdownDescription': ( localizeWithPath(
|
|
285
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
286
|
+
'watcherExclude',
|
|
287
|
+
"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."
|
|
288
|
+
)),
|
|
289
|
+
'scope': 4
|
|
290
|
+
},
|
|
291
|
+
'files.watcherInclude': {
|
|
292
|
+
'type': 'array',
|
|
293
|
+
'items': {
|
|
294
|
+
'type': 'string'
|
|
295
|
+
},
|
|
296
|
+
'default': [],
|
|
297
|
+
'description': ( localizeWithPath(
|
|
298
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
299
|
+
'watcherInclude',
|
|
300
|
+
"Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."
|
|
301
|
+
)),
|
|
302
|
+
'scope': 4
|
|
303
|
+
},
|
|
304
|
+
'files.hotExit': hotExitConfiguration,
|
|
305
|
+
'files.defaultLanguage': {
|
|
306
|
+
'type': 'string',
|
|
307
|
+
'markdownDescription': ( localizeWithPath(
|
|
308
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
309
|
+
'defaultLanguage',
|
|
310
|
+
"The default language identifier that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language identifier of the currently active text editor if any."
|
|
311
|
+
))
|
|
312
|
+
},
|
|
313
|
+
[FILES_READONLY_INCLUDE_CONFIG]: {
|
|
314
|
+
'type': 'object',
|
|
315
|
+
'patternProperties': {
|
|
316
|
+
'.*': { 'type': 'boolean' }
|
|
317
|
+
},
|
|
318
|
+
'default': {},
|
|
319
|
+
'markdownDescription': ( localizeWithPath(
|
|
320
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
321
|
+
'filesReadonlyInclude',
|
|
322
|
+
"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to mark as read-only. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. You can exclude matching paths via the `#files.readonlyExclude#` setting. Files from readonly file system providers will always be read-only independent of this setting."
|
|
323
|
+
)),
|
|
324
|
+
'scope': 4
|
|
325
|
+
},
|
|
326
|
+
[FILES_READONLY_EXCLUDE_CONFIG]: {
|
|
327
|
+
'type': 'object',
|
|
328
|
+
'patternProperties': {
|
|
329
|
+
'.*': { 'type': 'boolean' }
|
|
330
|
+
},
|
|
331
|
+
'default': {},
|
|
332
|
+
'markdownDescription': ( localizeWithPath(
|
|
333
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
334
|
+
'filesReadonlyExclude',
|
|
335
|
+
"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from being marked as read-only if they match as a result of the `#files.readonlyInclude#` setting. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Files from readonly file system providers will always be read-only independent of this setting."
|
|
336
|
+
)),
|
|
337
|
+
'scope': 4
|
|
338
|
+
},
|
|
339
|
+
[FILES_READONLY_FROM_PERMISSIONS_CONFIG]: {
|
|
340
|
+
'type': 'boolean',
|
|
341
|
+
'markdownDescription': ( localizeWithPath(
|
|
342
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
343
|
+
'filesReadonlyFromPermissions',
|
|
344
|
+
"Marks files as read-only when their file permissions indicate as such. This can be overridden via `#files.readonlyInclude#` and `#files.readonlyExclude#` settings."
|
|
345
|
+
)),
|
|
346
|
+
'default': false
|
|
347
|
+
},
|
|
348
|
+
'files.restoreUndoStack': {
|
|
349
|
+
'type': 'boolean',
|
|
350
|
+
'description': ( localizeWithPath(
|
|
351
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
352
|
+
'files.restoreUndoStack',
|
|
353
|
+
"Restore the undo stack when a file is reopened."
|
|
354
|
+
)),
|
|
355
|
+
'default': true
|
|
356
|
+
},
|
|
357
|
+
'files.saveConflictResolution': {
|
|
358
|
+
'type': 'string',
|
|
359
|
+
'enum': [
|
|
360
|
+
'askUser',
|
|
361
|
+
'overwriteFileOnDisk'
|
|
362
|
+
],
|
|
363
|
+
'enumDescriptions': [
|
|
364
|
+
( localizeWithPath(
|
|
365
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
366
|
+
'askUser',
|
|
367
|
+
"Will refuse to save and ask for resolving the save conflict manually."
|
|
368
|
+
)),
|
|
369
|
+
( localizeWithPath(
|
|
370
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
371
|
+
'overwriteFileOnDisk',
|
|
372
|
+
"Will resolve the save conflict by overwriting the file on disk with the changes in the editor."
|
|
373
|
+
))
|
|
374
|
+
],
|
|
375
|
+
'description': ( localizeWithPath(
|
|
376
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
377
|
+
'files.saveConflictResolution',
|
|
378
|
+
"A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."
|
|
379
|
+
)),
|
|
380
|
+
'default': 'askUser',
|
|
381
|
+
'scope': 5
|
|
382
|
+
},
|
|
383
|
+
'files.dialog.defaultPath': {
|
|
384
|
+
'type': 'string',
|
|
385
|
+
'pattern': '^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$',
|
|
386
|
+
'patternErrorMessage': ( localizeWithPath(
|
|
387
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
388
|
+
'defaultPathErrorMessage',
|
|
389
|
+
"Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."
|
|
390
|
+
)),
|
|
391
|
+
'description': ( localizeWithPath(
|
|
392
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
393
|
+
'fileDialogDefaultPath',
|
|
394
|
+
"Default path for file dialogs, overriding user's home path. Only used in the absence of a context-specific path, such as most recently opened file or folder."
|
|
395
|
+
)),
|
|
396
|
+
'scope': 2
|
|
397
|
+
},
|
|
398
|
+
'files.simpleDialog.enable': {
|
|
399
|
+
'type': 'boolean',
|
|
400
|
+
'description': ( localizeWithPath(
|
|
401
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
402
|
+
'files.simpleDialog.enable',
|
|
403
|
+
"Enables the simple file dialog for opening and saving files and folders. The simple file dialog replaces the system file dialog when enabled."
|
|
404
|
+
)),
|
|
405
|
+
'default': false
|
|
406
|
+
},
|
|
407
|
+
'files.participants.timeout': {
|
|
408
|
+
type: 'number',
|
|
409
|
+
default: 60000,
|
|
410
|
+
markdownDescription: ( localizeWithPath(
|
|
411
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
412
|
+
'files.participants.timeout',
|
|
413
|
+
"Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants."
|
|
414
|
+
)),
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
configurationRegistry.registerConfiguration({
|
|
419
|
+
...editorConfigurationBaseNode,
|
|
420
|
+
properties: {
|
|
421
|
+
'editor.formatOnSave': {
|
|
422
|
+
'type': 'boolean',
|
|
423
|
+
'description': ( localizeWithPath(
|
|
424
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
425
|
+
'formatOnSave',
|
|
426
|
+
"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."
|
|
427
|
+
)),
|
|
428
|
+
'scope': 5 ,
|
|
429
|
+
},
|
|
430
|
+
'editor.formatOnSaveMode': {
|
|
431
|
+
'type': 'string',
|
|
432
|
+
'default': 'file',
|
|
433
|
+
'enum': [
|
|
434
|
+
'file',
|
|
435
|
+
'modifications',
|
|
436
|
+
'modificationsIfAvailable'
|
|
437
|
+
],
|
|
438
|
+
'enumDescriptions': [
|
|
439
|
+
( localizeWithPath(
|
|
440
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
441
|
+
{ key: 'everything', comment: ['This is the description of an option'] },
|
|
442
|
+
"Format the whole file."
|
|
443
|
+
)),
|
|
444
|
+
( localizeWithPath(
|
|
445
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
446
|
+
{ key: 'modification', comment: ['This is the description of an option'] },
|
|
447
|
+
"Format modifications (requires source control)."
|
|
448
|
+
)),
|
|
449
|
+
( localizeWithPath(
|
|
450
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
451
|
+
{ key: 'modificationIfAvailable', comment: ['This is the description of an option'] },
|
|
452
|
+
"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted."
|
|
453
|
+
)),
|
|
454
|
+
],
|
|
455
|
+
'markdownDescription': ( localizeWithPath(
|
|
456
|
+
'vs/workbench/contrib/files/browser/files.configuration.contribution',
|
|
457
|
+
'formatOnSaveMode',
|
|
458
|
+
"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."
|
|
459
|
+
)),
|
|
460
|
+
'scope': 5 ,
|
|
461
|
+
},
|
|
462
|
+
}
|
|
463
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Registry } from '../../../../platform/registry/common/platform.js';
|
|
2
|
+
import { EditorExtensions } from '../../../common/editor.js';
|
|
3
|
+
import { FileEditorInput } from './editors/fileEditorInput.js';
|
|
4
|
+
import { FILE_EDITOR_INPUT_ID } from '../common/files.js';
|
|
5
|
+
( Registry.as(EditorExtensions.EditorFactory)).registerFileEditorFactory({
|
|
6
|
+
typeId: FILE_EDITOR_INPUT_ID,
|
|
7
|
+
createFileEditor: (resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents, instantiationService) => {
|
|
8
|
+
return instantiationService.createInstance(FileEditorInput, resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents);
|
|
9
|
+
},
|
|
10
|
+
isFileEditor: (obj) => {
|
|
11
|
+
return obj instanceof FileEditorInput;
|
|
12
|
+
}
|
|
13
|
+
});
|