@codingame/monaco-vscode-dialogs-service-override 4.1.0 → 4.1.2
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/dialogs.js +4 -4
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/package.json +2 -2
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +76 -0
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.js +134 -0
- package/vscode/src/vs/workbench/common/dialogs.js +38 -0
- package/vscode/src/vs/workbench/contrib/welcomeDialog/browser/media/welcomeWidget.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/welcomeDialog/browser/welcomeDialog.contribution.js +103 -0
- package/vscode/src/vs/workbench/contrib/welcomeDialog/browser/welcomeWidget.js +189 -0
- package/vscode/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.js +379 -0
- package/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.js +1039 -0
- package/vscode/src/vs/workbench/services/dialogs/common/dialogService.js +72 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { isWorkspaceToOpen, isFileToOpen } from 'vscode/vscode/vs/platform/window/common/window';
|
|
4
|
+
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
5
|
+
import { isSavedWorkspace, isTemporaryWorkspace, WORKSPACE_EXTENSION, IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
6
|
+
import { IHistoryService } from 'vscode/vscode/vs/workbench/services/history/common/history';
|
|
7
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
8
|
+
import { dirname, toLocalResource, basename, extname } from 'vscode/vscode/vs/base/common/resources';
|
|
9
|
+
import { isAbsolute, normalize } from 'vscode/vscode/vs/base/common/path';
|
|
10
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
+
import { SimpleFileDialog } from './simpleFileDialog.js';
|
|
12
|
+
import { IWorkspacesService } from 'vscode/vscode/vs/platform/workspaces/common/workspaces';
|
|
13
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
14
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
15
|
+
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
16
|
+
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
17
|
+
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
18
|
+
import { coalesce, distinct } from 'vscode/vscode/vs/base/common/arrays';
|
|
19
|
+
import { trim } from 'vscode/vscode/vs/base/common/strings';
|
|
20
|
+
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
21
|
+
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
22
|
+
import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService';
|
|
23
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
24
|
+
import { PLAINTEXT_EXTENSION } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
|
|
25
|
+
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
26
|
+
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
27
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
28
|
+
import { EditorOpenSource } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
29
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
30
|
+
import { getFileNamesMessage, IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
31
|
+
|
|
32
|
+
let AbstractFileDialogService = class AbstractFileDialogService {
|
|
33
|
+
constructor(hostService, contextService, historyService, environmentService, instantiationService, configurationService, fileService, openerService, dialogService, languageService, workspacesService, labelService, pathService, commandService, editorService, codeEditorService, logService) {
|
|
34
|
+
this.hostService = hostService;
|
|
35
|
+
this.contextService = contextService;
|
|
36
|
+
this.historyService = historyService;
|
|
37
|
+
this.environmentService = environmentService;
|
|
38
|
+
this.instantiationService = instantiationService;
|
|
39
|
+
this.configurationService = configurationService;
|
|
40
|
+
this.fileService = fileService;
|
|
41
|
+
this.openerService = openerService;
|
|
42
|
+
this.dialogService = dialogService;
|
|
43
|
+
this.languageService = languageService;
|
|
44
|
+
this.workspacesService = workspacesService;
|
|
45
|
+
this.labelService = labelService;
|
|
46
|
+
this.pathService = pathService;
|
|
47
|
+
this.commandService = commandService;
|
|
48
|
+
this.editorService = editorService;
|
|
49
|
+
this.codeEditorService = codeEditorService;
|
|
50
|
+
this.logService = logService;
|
|
51
|
+
}
|
|
52
|
+
async defaultFilePath(schemeFilter = this.getSchemeFilterForWindow(), authorityFilter = this.getAuthorityFilterForWindow()) {
|
|
53
|
+
let candidate = this.historyService.getLastActiveFile(schemeFilter, authorityFilter);
|
|
54
|
+
if (!candidate) {
|
|
55
|
+
candidate = this.historyService.getLastActiveWorkspaceRoot(schemeFilter, authorityFilter);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
candidate = dirname(candidate);
|
|
59
|
+
}
|
|
60
|
+
if (!candidate) {
|
|
61
|
+
candidate = await this.preferredHome(schemeFilter);
|
|
62
|
+
}
|
|
63
|
+
return candidate;
|
|
64
|
+
}
|
|
65
|
+
async defaultFolderPath(schemeFilter = this.getSchemeFilterForWindow(), authorityFilter = this.getAuthorityFilterForWindow()) {
|
|
66
|
+
let candidate = this.historyService.getLastActiveWorkspaceRoot(schemeFilter, authorityFilter);
|
|
67
|
+
if (!candidate) {
|
|
68
|
+
candidate = this.historyService.getLastActiveFile(schemeFilter, authorityFilter);
|
|
69
|
+
}
|
|
70
|
+
if (!candidate) {
|
|
71
|
+
return this.preferredHome(schemeFilter);
|
|
72
|
+
}
|
|
73
|
+
return dirname(candidate);
|
|
74
|
+
}
|
|
75
|
+
async preferredHome(schemeFilter = this.getSchemeFilterForWindow()) {
|
|
76
|
+
const preferLocal = schemeFilter === Schemas.file;
|
|
77
|
+
const preferredHomeConfig = this.configurationService.inspect('files.dialog.defaultPath');
|
|
78
|
+
const preferredHomeCandidate = preferLocal ? preferredHomeConfig.userLocalValue : preferredHomeConfig.userRemoteValue;
|
|
79
|
+
if (preferredHomeCandidate) {
|
|
80
|
+
const isPreferredHomeCandidateAbsolute = preferLocal ? isAbsolute(preferredHomeCandidate) : (await this.pathService.path).isAbsolute(preferredHomeCandidate);
|
|
81
|
+
if (isPreferredHomeCandidateAbsolute) {
|
|
82
|
+
const preferredHomeNormalized = preferLocal ? normalize(preferredHomeCandidate) : (await this.pathService.path).normalize(preferredHomeCandidate);
|
|
83
|
+
const preferredHome = toLocalResource(await this.pathService.fileURI(preferredHomeNormalized), this.environmentService.remoteAuthority, this.pathService.defaultUriScheme);
|
|
84
|
+
if (await this.fileService.exists(preferredHome)) {
|
|
85
|
+
return preferredHome;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return this.pathService.userHome({ preferLocal });
|
|
90
|
+
}
|
|
91
|
+
async defaultWorkspacePath(schemeFilter = this.getSchemeFilterForWindow()) {
|
|
92
|
+
let defaultWorkspacePath;
|
|
93
|
+
if (this.contextService.getWorkbenchState() === 3 ) {
|
|
94
|
+
const configuration = this.contextService.getWorkspace().configuration;
|
|
95
|
+
if (configuration?.scheme === schemeFilter && isSavedWorkspace(configuration, this.environmentService) && !isTemporaryWorkspace(configuration)) {
|
|
96
|
+
defaultWorkspacePath = dirname(configuration);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!defaultWorkspacePath) {
|
|
100
|
+
defaultWorkspacePath = await this.defaultFilePath(schemeFilter);
|
|
101
|
+
}
|
|
102
|
+
return defaultWorkspacePath;
|
|
103
|
+
}
|
|
104
|
+
async showSaveConfirm(fileNamesOrResources) {
|
|
105
|
+
if (this.skipDialogs()) {
|
|
106
|
+
this.logService.trace('FileDialogService: refused to show save confirmation dialog in tests.');
|
|
107
|
+
return 1 ;
|
|
108
|
+
}
|
|
109
|
+
return this.doShowSaveConfirm(fileNamesOrResources);
|
|
110
|
+
}
|
|
111
|
+
skipDialogs() {
|
|
112
|
+
if (this.environmentService.isExtensionDevelopment && this.environmentService.extensionTestsLocationURI) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return !!this.environmentService.enableSmokeTestDriver;
|
|
116
|
+
}
|
|
117
|
+
async doShowSaveConfirm(fileNamesOrResources) {
|
|
118
|
+
if (fileNamesOrResources.length === 0) {
|
|
119
|
+
return 1 ;
|
|
120
|
+
}
|
|
121
|
+
let message;
|
|
122
|
+
let detail = ( localizeWithPath(
|
|
123
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
124
|
+
'saveChangesDetail',
|
|
125
|
+
"Your changes will be lost if you don't save them."
|
|
126
|
+
));
|
|
127
|
+
if (fileNamesOrResources.length === 1) {
|
|
128
|
+
message = ( localizeWithPath(
|
|
129
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
130
|
+
'saveChangesMessage',
|
|
131
|
+
"Do you want to save the changes you made to {0}?",
|
|
132
|
+
typeof fileNamesOrResources[0] === 'string' ? fileNamesOrResources[0] : basename(fileNamesOrResources[0])
|
|
133
|
+
));
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
message = ( localizeWithPath(
|
|
137
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
138
|
+
'saveChangesMessages',
|
|
139
|
+
"Do you want to save the changes to the following {0} files?",
|
|
140
|
+
fileNamesOrResources.length
|
|
141
|
+
));
|
|
142
|
+
detail = getFileNamesMessage(fileNamesOrResources) + '\n' + detail;
|
|
143
|
+
}
|
|
144
|
+
const { result } = await this.dialogService.prompt({
|
|
145
|
+
type: Severity$1.Warning,
|
|
146
|
+
message,
|
|
147
|
+
detail,
|
|
148
|
+
buttons: [
|
|
149
|
+
{
|
|
150
|
+
label: fileNamesOrResources.length > 1 ?
|
|
151
|
+
( localizeWithPath(
|
|
152
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
153
|
+
{ key: 'saveAll', comment: ['&& denotes a mnemonic'] },
|
|
154
|
+
"&&Save All"
|
|
155
|
+
)) :
|
|
156
|
+
( localizeWithPath(
|
|
157
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
158
|
+
{ key: 'save', comment: ['&& denotes a mnemonic'] },
|
|
159
|
+
"&&Save"
|
|
160
|
+
)),
|
|
161
|
+
run: () => 0
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: ( localizeWithPath(
|
|
165
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
166
|
+
{ key: 'dontSave', comment: ['&& denotes a mnemonic'] },
|
|
167
|
+
"Do&&n't Save"
|
|
168
|
+
)),
|
|
169
|
+
run: () => 1
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
cancelButton: {
|
|
173
|
+
run: () => 2
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
addFileSchemaIfNeeded(schema, _isFolder) {
|
|
179
|
+
return schema === Schemas.untitled ? [Schemas.file] : (schema !== Schemas.file ? [schema, Schemas.file] : [schema]);
|
|
180
|
+
}
|
|
181
|
+
async pickFileFolderAndOpenSimplified(schema, options, preferNewWindow) {
|
|
182
|
+
const title = ( localizeWithPath(
|
|
183
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
184
|
+
'openFileOrFolder.title',
|
|
185
|
+
'Open File or Folder'
|
|
186
|
+
));
|
|
187
|
+
const availableFileSystems = this.addFileSchemaIfNeeded(schema);
|
|
188
|
+
const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: true, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
|
|
189
|
+
if (uri) {
|
|
190
|
+
const stat = await this.fileService.stat(uri);
|
|
191
|
+
const toOpen = stat.isDirectory ? { folderUri: uri } : { fileUri: uri };
|
|
192
|
+
if (!isWorkspaceToOpen(toOpen) && isFileToOpen(toOpen)) {
|
|
193
|
+
this.addFileToRecentlyOpened(toOpen.fileUri);
|
|
194
|
+
}
|
|
195
|
+
if (stat.isDirectory || options.forceNewWindow || preferNewWindow) {
|
|
196
|
+
await this.hostService.openWindow([toOpen], { forceNewWindow: options.forceNewWindow, remoteAuthority: options.remoteAuthority });
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
await this.editorService.openEditors([{ resource: uri, options: { source: EditorOpenSource.USER, pinned: true } }], undefined, { validateTrust: true });
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async pickFileAndOpenSimplified(schema, options, preferNewWindow) {
|
|
204
|
+
const title = ( localizeWithPath(
|
|
205
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
206
|
+
'openFile.title',
|
|
207
|
+
'Open File'
|
|
208
|
+
));
|
|
209
|
+
const availableFileSystems = this.addFileSchemaIfNeeded(schema);
|
|
210
|
+
const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: false, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
|
|
211
|
+
if (uri) {
|
|
212
|
+
this.addFileToRecentlyOpened(uri);
|
|
213
|
+
if (options.forceNewWindow || preferNewWindow) {
|
|
214
|
+
await this.hostService.openWindow([{ fileUri: uri }], { forceNewWindow: options.forceNewWindow, remoteAuthority: options.remoteAuthority });
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
await this.editorService.openEditors([{ resource: uri, options: { source: EditorOpenSource.USER, pinned: true } }], undefined, { validateTrust: true });
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
addFileToRecentlyOpened(uri) {
|
|
222
|
+
this.workspacesService.addRecentlyOpened([{ fileUri: uri, label: this.labelService.getUriLabel(uri) }]);
|
|
223
|
+
}
|
|
224
|
+
async pickFolderAndOpenSimplified(schema, options) {
|
|
225
|
+
const title = ( localizeWithPath(
|
|
226
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
227
|
+
'openFolder.title',
|
|
228
|
+
'Open Folder'
|
|
229
|
+
));
|
|
230
|
+
const availableFileSystems = this.addFileSchemaIfNeeded(schema, true);
|
|
231
|
+
const uri = await this.pickResource({ canSelectFiles: false, canSelectFolders: true, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
|
|
232
|
+
if (uri) {
|
|
233
|
+
return this.hostService.openWindow([{ folderUri: uri }], { forceNewWindow: options.forceNewWindow, remoteAuthority: options.remoteAuthority });
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async pickWorkspaceAndOpenSimplified(schema, options) {
|
|
237
|
+
const title = ( localizeWithPath(
|
|
238
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
239
|
+
'openWorkspace.title',
|
|
240
|
+
'Open Workspace from File'
|
|
241
|
+
));
|
|
242
|
+
const filters = [{ name: ( localizeWithPath(
|
|
243
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
244
|
+
'filterName.workspace',
|
|
245
|
+
'Workspace'
|
|
246
|
+
)), extensions: [WORKSPACE_EXTENSION] }];
|
|
247
|
+
const availableFileSystems = this.addFileSchemaIfNeeded(schema, true);
|
|
248
|
+
const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: false, canSelectMany: false, defaultUri: options.defaultUri, title, filters, availableFileSystems });
|
|
249
|
+
if (uri) {
|
|
250
|
+
return this.hostService.openWindow([{ workspaceUri: uri }], { forceNewWindow: options.forceNewWindow, remoteAuthority: options.remoteAuthority });
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
async pickFileToSaveSimplified(schema, options) {
|
|
254
|
+
if (!options.availableFileSystems) {
|
|
255
|
+
options.availableFileSystems = this.addFileSchemaIfNeeded(schema);
|
|
256
|
+
}
|
|
257
|
+
options.title = ( localizeWithPath(
|
|
258
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
259
|
+
'saveFileAs.title',
|
|
260
|
+
'Save As'
|
|
261
|
+
));
|
|
262
|
+
const uri = await this.saveRemoteResource(options);
|
|
263
|
+
if (uri) {
|
|
264
|
+
this.addFileToRecentlyOpened(uri);
|
|
265
|
+
}
|
|
266
|
+
return uri;
|
|
267
|
+
}
|
|
268
|
+
async showSaveDialogSimplified(schema, options) {
|
|
269
|
+
if (!options.availableFileSystems) {
|
|
270
|
+
options.availableFileSystems = this.addFileSchemaIfNeeded(schema);
|
|
271
|
+
}
|
|
272
|
+
return this.saveRemoteResource(options);
|
|
273
|
+
}
|
|
274
|
+
async showOpenDialogSimplified(schema, options) {
|
|
275
|
+
if (!options.availableFileSystems) {
|
|
276
|
+
options.availableFileSystems = this.addFileSchemaIfNeeded(schema, options.canSelectFolders);
|
|
277
|
+
}
|
|
278
|
+
const uri = await this.pickResource(options);
|
|
279
|
+
return uri ? [uri] : undefined;
|
|
280
|
+
}
|
|
281
|
+
getSimpleFileDialog() {
|
|
282
|
+
return this.instantiationService.createInstance(SimpleFileDialog);
|
|
283
|
+
}
|
|
284
|
+
pickResource(options) {
|
|
285
|
+
return this.getSimpleFileDialog().showOpenDialog(options);
|
|
286
|
+
}
|
|
287
|
+
saveRemoteResource(options) {
|
|
288
|
+
return this.getSimpleFileDialog().showSaveDialog(options);
|
|
289
|
+
}
|
|
290
|
+
getSchemeFilterForWindow(defaultUriScheme) {
|
|
291
|
+
return defaultUriScheme ?? this.pathService.defaultUriScheme;
|
|
292
|
+
}
|
|
293
|
+
getAuthorityFilterForWindow() {
|
|
294
|
+
return this.environmentService.remoteAuthority;
|
|
295
|
+
}
|
|
296
|
+
getFileSystemSchema(options) {
|
|
297
|
+
return options.availableFileSystems && options.availableFileSystems[0] || this.getSchemeFilterForWindow(options.defaultUri?.scheme);
|
|
298
|
+
}
|
|
299
|
+
getWorkspaceAvailableFileSystems(options) {
|
|
300
|
+
if (options.availableFileSystems && (options.availableFileSystems.length > 0)) {
|
|
301
|
+
return options.availableFileSystems;
|
|
302
|
+
}
|
|
303
|
+
const availableFileSystems = [Schemas.file];
|
|
304
|
+
if (this.environmentService.remoteAuthority) {
|
|
305
|
+
availableFileSystems.unshift(Schemas.vscodeRemote);
|
|
306
|
+
}
|
|
307
|
+
return availableFileSystems;
|
|
308
|
+
}
|
|
309
|
+
getPickFileToSaveDialogOptions(defaultUri, availableFileSystems) {
|
|
310
|
+
const options = {
|
|
311
|
+
defaultUri,
|
|
312
|
+
title: ( localizeWithPath(
|
|
313
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
314
|
+
'saveAsTitle',
|
|
315
|
+
"Save As"
|
|
316
|
+
)),
|
|
317
|
+
availableFileSystems
|
|
318
|
+
};
|
|
319
|
+
const ext = defaultUri ? extname(defaultUri) : undefined;
|
|
320
|
+
let matchingFilter;
|
|
321
|
+
const registeredLanguageNames = this.languageService.getSortedRegisteredLanguageNames();
|
|
322
|
+
const registeredLanguageFilters = coalesce(( registeredLanguageNames.map(({ languageName, languageId }) => {
|
|
323
|
+
const extensions = this.languageService.getExtensions(languageId);
|
|
324
|
+
if (!extensions.length) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
const filter = { name: languageName, extensions: ( distinct(extensions).slice(0, 10).map(e => trim(e, '.'))) };
|
|
328
|
+
const extOrPlaintext = ext || PLAINTEXT_EXTENSION;
|
|
329
|
+
if (!matchingFilter && extensions.includes(extOrPlaintext)) {
|
|
330
|
+
matchingFilter = filter;
|
|
331
|
+
const trimmedExt = trim(extOrPlaintext, '.');
|
|
332
|
+
if (!filter.extensions.includes(trimmedExt)) {
|
|
333
|
+
filter.extensions.unshift(trimmedExt);
|
|
334
|
+
}
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
return filter;
|
|
338
|
+
})));
|
|
339
|
+
if (!matchingFilter && ext) {
|
|
340
|
+
matchingFilter = { name: trim(ext, '.').toUpperCase(), extensions: [trim(ext, '.')] };
|
|
341
|
+
}
|
|
342
|
+
options.filters = coalesce([
|
|
343
|
+
{ name: ( localizeWithPath(
|
|
344
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
345
|
+
'allFiles',
|
|
346
|
+
"All Files"
|
|
347
|
+
)), extensions: ['*'] },
|
|
348
|
+
matchingFilter,
|
|
349
|
+
...registeredLanguageFilters,
|
|
350
|
+
{ name: ( localizeWithPath(
|
|
351
|
+
'vs/workbench/services/dialogs/browser/abstractFileDialogService',
|
|
352
|
+
'noExt',
|
|
353
|
+
"No Extension"
|
|
354
|
+
)), extensions: [''] }
|
|
355
|
+
]);
|
|
356
|
+
return options;
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
AbstractFileDialogService = ( __decorate([
|
|
360
|
+
( __param(0, IHostService)),
|
|
361
|
+
( __param(1, IWorkspaceContextService)),
|
|
362
|
+
( __param(2, IHistoryService)),
|
|
363
|
+
( __param(3, IWorkbenchEnvironmentService)),
|
|
364
|
+
( __param(4, IInstantiationService)),
|
|
365
|
+
( __param(5, IConfigurationService)),
|
|
366
|
+
( __param(6, IFileService)),
|
|
367
|
+
( __param(7, IOpenerService)),
|
|
368
|
+
( __param(8, IDialogService)),
|
|
369
|
+
( __param(9, ILanguageService)),
|
|
370
|
+
( __param(10, IWorkspacesService)),
|
|
371
|
+
( __param(11, ILabelService)),
|
|
372
|
+
( __param(12, IPathService)),
|
|
373
|
+
( __param(13, ICommandService)),
|
|
374
|
+
( __param(14, IEditorService)),
|
|
375
|
+
( __param(15, ICodeEditorService)),
|
|
376
|
+
( __param(16, ILogService))
|
|
377
|
+
], AbstractFileDialogService));
|
|
378
|
+
|
|
379
|
+
export { AbstractFileDialogService };
|