@codingame/monaco-vscode-configuration-service-override 4.5.0 → 4.5.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.
@@ -24,14 +24,11 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
24
24
  import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
25
25
  import { firstOrDefault } from 'vscode/vscode/vs/base/common/arrays';
26
26
 
27
+ const _moduleId = "vs/workbench/services/label/common/labelService";
27
28
  const resourceLabelFormattersExtPoint = ExtensionsRegistry.registerExtensionPoint({
28
29
  extensionPoint: 'resourceLabelFormatters',
29
30
  jsonSchema: {
30
- description: ( localizeWithPath(
31
- 'vs/workbench/services/label/common/labelService',
32
- 'vscode.extension.contributes.resourceLabelFormatters',
33
- 'Contributes resource label formatting rules.'
34
- )),
31
+ description: ( localizeWithPath(_moduleId, 0, 'Contributes resource label formatting rules.')),
35
32
  type: 'array',
36
33
  items: {
37
34
  type: 'object',
@@ -40,66 +37,58 @@ const resourceLabelFormattersExtPoint = ExtensionsRegistry.registerExtensionPoin
40
37
  scheme: {
41
38
  type: 'string',
42
39
  description: ( localizeWithPath(
43
- 'vs/workbench/services/label/common/labelService',
44
- 'vscode.extension.contributes.resourceLabelFormatters.scheme',
40
+ _moduleId,
41
+ 1,
45
42
  'URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported.'
46
43
  )),
47
44
  },
48
45
  authority: {
49
46
  type: 'string',
50
47
  description: ( localizeWithPath(
51
- 'vs/workbench/services/label/common/labelService',
52
- 'vscode.extension.contributes.resourceLabelFormatters.authority',
48
+ _moduleId,
49
+ 2,
53
50
  'URI authority on which to match the formatter on. Simple glob patterns are supported.'
54
51
  )),
55
52
  },
56
53
  formatting: {
57
- description: ( localizeWithPath(
58
- 'vs/workbench/services/label/common/labelService',
59
- 'vscode.extension.contributes.resourceLabelFormatters.formatting',
60
- "Rules for formatting uri resource labels."
61
- )),
54
+ description: ( localizeWithPath(_moduleId, 3, "Rules for formatting uri resource labels.")),
62
55
  type: 'object',
63
56
  properties: {
64
57
  label: {
65
58
  type: 'string',
66
59
  description: ( localizeWithPath(
67
- 'vs/workbench/services/label/common/labelService',
68
- 'vscode.extension.contributes.resourceLabelFormatters.label',
60
+ _moduleId,
61
+ 4,
69
62
  "Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables."
70
63
  ))
71
64
  },
72
65
  separator: {
73
66
  type: 'string',
74
67
  description: ( localizeWithPath(
75
- 'vs/workbench/services/label/common/labelService',
76
- 'vscode.extension.contributes.resourceLabelFormatters.separator',
68
+ _moduleId,
69
+ 5,
77
70
  "Separator to be used in the uri label display. '/' or '\' as an example."
78
71
  ))
79
72
  },
80
73
  stripPathStartingSeparator: {
81
74
  type: 'boolean',
82
75
  description: ( localizeWithPath(
83
- 'vs/workbench/services/label/common/labelService',
84
- 'vscode.extension.contributes.resourceLabelFormatters.stripPathStartingSeparator',
76
+ _moduleId,
77
+ 6,
85
78
  "Controls whether `${path}` substitutions should have starting separator characters stripped."
86
79
  ))
87
80
  },
88
81
  tildify: {
89
82
  type: 'boolean',
90
83
  description: ( localizeWithPath(
91
- 'vs/workbench/services/label/common/labelService',
92
- 'vscode.extension.contributes.resourceLabelFormatters.tildify',
84
+ _moduleId,
85
+ 7,
93
86
  "Controls if the start of the uri label should be tildified when possible."
94
87
  ))
95
88
  },
96
89
  workspaceSuffix: {
97
90
  type: 'string',
98
- description: ( localizeWithPath(
99
- 'vs/workbench/services/label/common/labelService',
100
- 'vscode.extension.contributes.resourceLabelFormatters.formatting.workspaceSuffix',
101
- "Suffix appended to the workspace label."
102
- ))
91
+ description: ( localizeWithPath(_moduleId, 8, "Suffix appended to the workspace label."))
103
92
  }
104
93
  }
105
94
  }
@@ -114,7 +103,7 @@ function hasDriveLetterIgnorePlatform(path) {
114
103
  }
115
104
  let ResourceLabelFormattersHandler = class ResourceLabelFormattersHandler {
116
105
  constructor(labelService) {
117
- this.formattersDisposables = ( new Map());
106
+ this.formattersDisposables = ( (new Map()));
118
107
  resourceLabelFormattersExtPoint.setHandler((extensions, delta) => {
119
108
  for (const added of delta.added) {
120
109
  for (const untrustedFormatter of added.value) {
@@ -139,10 +128,10 @@ let ResourceLabelFormattersHandler = class ResourceLabelFormattersHandler {
139
128
  });
140
129
  }
141
130
  };
142
- ResourceLabelFormattersHandler = ( __decorate([
143
- ( __param(0, ILabelService))
144
- ], ResourceLabelFormattersHandler));
145
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ResourceLabelFormattersHandler, 3 );
131
+ ResourceLabelFormattersHandler = ( (__decorate([
132
+ ( (__param(0, ILabelService)))
133
+ ], ResourceLabelFormattersHandler)));
134
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(ResourceLabelFormattersHandler, 3 );
146
135
  const FORMATTER_CACHE_SIZE = 50;
147
136
  let LabelService = class LabelService extends Disposable {
148
137
  constructor(environmentService, contextService, pathService, remoteAgentService, storageService, lifecycleService) {
@@ -151,11 +140,11 @@ let LabelService = class LabelService extends Disposable {
151
140
  this.contextService = contextService;
152
141
  this.pathService = pathService;
153
142
  this.remoteAgentService = remoteAgentService;
154
- this._onDidChangeFormatters = this._register(( new Emitter({ leakWarningThreshold: 400 })));
143
+ this._onDidChangeFormatters = this._register(( (new Emitter({ leakWarningThreshold: 400 }))));
155
144
  this.onDidChangeFormatters = this._onDidChangeFormatters.event;
156
145
  this.os = OS;
157
146
  this.userHome = pathService.defaultUriScheme === Schemas.file ? this.pathService.userHome({ preferLocal: true }) : undefined;
158
- const memento = this.storedFormattersMemento = ( new Memento('cachedResourceLabelFormatters2', storageService));
147
+ const memento = this.storedFormattersMemento = ( (new Memento('cachedResourceLabelFormatters2', storageService)));
159
148
  this.storedFormatters = memento.getMemento(0 , 1 );
160
149
  this.formatters = this.storedFormatters?.formatters?.slice() || [];
161
150
  this.resolveRemoteEnvironment();
@@ -278,18 +267,10 @@ let LabelService = class LabelService extends Disposable {
278
267
  }
279
268
  doGetWorkspaceLabel(workspaceUri, options) {
280
269
  if (isUntitledWorkspace(workspaceUri, this.environmentService)) {
281
- return ( localizeWithPath(
282
- 'vs/workbench/services/label/common/labelService',
283
- 'untitledWorkspace',
284
- "Untitled (Workspace)"
285
- ));
270
+ return ( localizeWithPath(_moduleId, 9, "Untitled (Workspace)"));
286
271
  }
287
272
  if (isTemporaryWorkspace(workspaceUri)) {
288
- return ( localizeWithPath(
289
- 'vs/workbench/services/label/common/labelService',
290
- 'temporaryWorkspace',
291
- "Workspace"
292
- ));
273
+ return ( localizeWithPath(_moduleId, 10, "Workspace"));
293
274
  }
294
275
  let filename = basename(workspaceUri);
295
276
  if (filename.endsWith(WORKSPACE_EXTENSION)) {
@@ -302,20 +283,15 @@ let LabelService = class LabelService extends Disposable {
302
283
  break;
303
284
  case 2 :
304
285
  label = ( localizeWithPath(
305
- 'vs/workbench/services/label/common/labelService',
306
- 'workspaceNameVerbose',
286
+ _moduleId,
287
+ 11,
307
288
  "{0} (Workspace)",
308
289
  this.getUriLabel(joinPath(dirname(workspaceUri), filename))
309
290
  ));
310
291
  break;
311
292
  case 1 :
312
293
  default:
313
- label = ( localizeWithPath(
314
- 'vs/workbench/services/label/common/labelService',
315
- 'workspaceName',
316
- "{0} (Workspace)",
317
- filename
318
- ));
294
+ label = ( localizeWithPath(_moduleId, 12, "{0} (Workspace)", filename));
319
295
  break;
320
296
  }
321
297
  if (options?.verbose === 0 ) {
@@ -341,15 +317,15 @@ let LabelService = class LabelService extends Disposable {
341
317
  return this.appendWorkspaceSuffix(label, folderUri);
342
318
  }
343
319
  getSeparator(scheme, authority) {
344
- const formatter = this.findFormatting(( URI.from({ scheme, authority })));
320
+ const formatter = this.findFormatting(( (URI.from({ scheme, authority }))));
345
321
  return formatter?.separator || posix.sep;
346
322
  }
347
323
  getHostLabel(scheme, authority) {
348
- const formatter = this.findFormatting(( URI.from({ scheme, authority })));
324
+ const formatter = this.findFormatting(( (URI.from({ scheme, authority }))));
349
325
  return formatter?.workspaceSuffix || authority || '';
350
326
  }
351
327
  getHostTooltip(scheme, authority) {
352
- const formatter = this.findFormatting(( URI.from({ scheme, authority })));
328
+ const formatter = this.findFormatting(( (URI.from({ scheme, authority }))));
353
329
  return formatter?.workspaceTooltip;
354
330
  }
355
331
  registerCachedFormatter(formatter) {
@@ -426,13 +402,13 @@ let LabelService = class LabelService extends Disposable {
426
402
  return suffix ? `${label} [${suffix}]` : label;
427
403
  }
428
404
  };
429
- LabelService = ( __decorate([
430
- ( __param(0, IWorkbenchEnvironmentService)),
431
- ( __param(1, IWorkspaceContextService)),
432
- ( __param(2, IPathService)),
433
- ( __param(3, IRemoteAgentService)),
434
- ( __param(4, IStorageService)),
435
- ( __param(5, ILifecycleService))
436
- ], LabelService));
405
+ LabelService = ( (__decorate([
406
+ ( (__param(0, IWorkbenchEnvironmentService))),
407
+ ( (__param(1, IWorkspaceContextService))),
408
+ ( (__param(2, IPathService))),
409
+ ( (__param(3, IRemoteAgentService))),
410
+ ( (__param(4, IStorageService))),
411
+ ( (__param(5, ILifecycleService)))
412
+ ], LabelService)));
437
413
 
438
414
  export { LabelService };
@@ -26,6 +26,7 @@ import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProf
26
26
  import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
27
27
  import Severity$1 from 'vscode/vscode/vs/base/common/severity';
28
28
 
29
+ const _moduleId = "vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService";
29
30
  let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
30
31
  constructor(jsonEditingService, contextService, configurationService, notificationService, commandService, fileService, textFileService, workspacesService, environmentService, fileDialogService, dialogService, hostService, uriIdentityService, workspaceTrustManagementService, userDataProfilesService, userDataProfileService) {
31
32
  this.jsonEditingService = jsonEditingService;
@@ -51,16 +52,8 @@ let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
51
52
  availableFileSystems.unshift(Schemas.vscodeRemote);
52
53
  }
53
54
  let workspacePath = await this.fileDialogService.showSaveDialog({
54
- saveLabel: mnemonicButtonLabel(( localizeWithPath(
55
- 'vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService',
56
- 'save',
57
- "Save"
58
- ))),
59
- title: ( localizeWithPath(
60
- 'vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService',
61
- 'saveWorkspace',
62
- "Save Workspace"
63
- )),
55
+ saveLabel: mnemonicButtonLabel(( localizeWithPath(_moduleId, 0, "Save"))),
56
+ title: ( localizeWithPath(_moduleId, 1, "Save Workspace")),
64
57
  filters: WORKSPACE_FILTER,
65
58
  defaultUri: joinPath(await this.fileDialogService.defaultWorkspacePath(), this.getNewWorkspaceName()),
66
59
  availableFileSystems
@@ -88,13 +81,13 @@ let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
88
81
  const folders = this.contextService.getWorkspace().folders;
89
82
  let foldersToDelete = [];
90
83
  if (typeof deleteCount === 'number') {
91
- foldersToDelete = ( folders.slice(index, index + deleteCount).map(folder => folder.uri));
84
+ foldersToDelete = ( (folders.slice(index, index + deleteCount).map(folder => folder.uri)));
92
85
  }
93
86
  let foldersToAdd = [];
94
87
  if (Array.isArray(foldersToAddCandidates)) {
95
- foldersToAdd = ( foldersToAddCandidates.map(
88
+ foldersToAdd = ( (foldersToAddCandidates.map(
96
89
  folderToAdd => ({ uri: removeTrailingPathSeparator(folderToAdd.uri), name: folderToAdd.name })
97
- ));
90
+ )));
98
91
  }
99
92
  const wantsToDelete = foldersToDelete.length > 0;
100
93
  const wantsToAdd = foldersToAdd.length > 0;
@@ -129,15 +122,15 @@ let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
129
122
  }
130
123
  }
131
124
  addFolders(foldersToAddCandidates, donotNotifyError = false) {
132
- const foldersToAdd = ( foldersToAddCandidates.map(
125
+ const foldersToAdd = ( (foldersToAddCandidates.map(
133
126
  folderToAdd => ({ uri: removeTrailingPathSeparator(folderToAdd.uri), name: folderToAdd.name })
134
- ));
127
+ )));
135
128
  return this.doAddFolders(foldersToAdd, undefined, donotNotifyError);
136
129
  }
137
130
  async doAddFolders(foldersToAdd, index, donotNotifyError = false) {
138
131
  const state = this.contextService.getWorkbenchState();
139
132
  if (state !== 3 ) {
140
- let newWorkspaceFolders = ( this.contextService.getWorkspace().folders.map(folder => ({ uri: folder.uri })));
133
+ let newWorkspaceFolders = ( (this.contextService.getWorkspace().folders.map(folder => ({ uri: folder.uri }))));
141
134
  newWorkspaceFolders.splice(typeof index === 'number' ? index : newWorkspaceFolders.length, 0, ...foldersToAdd);
142
135
  newWorkspaceFolders = distinct(newWorkspaceFolders, folder => this.uriIdentityService.extUri.getComparisonKey(folder.uri));
143
136
  if (state === 1 && newWorkspaceFolders.length === 0 || state === 2 && newWorkspaceFolders.length === 1) {
@@ -172,9 +165,11 @@ let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
172
165
  includesSingleFolderWorkspace(folders) {
173
166
  if (this.contextService.getWorkbenchState() === 2 ) {
174
167
  const workspaceFolder = this.contextService.getWorkspace().folders[0];
175
- return ( folders.some(
176
- folder => this.uriIdentityService.extUri.isEqual(folder, workspaceFolder.uri)
177
- ));
168
+ return (
169
+ (folders.some(
170
+ folder => this.uriIdentityService.extUri.isEqual(folder, workspaceFolder.uri)
171
+ ))
172
+ );
178
173
  }
179
174
  return false;
180
175
  }
@@ -229,7 +224,7 @@ let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
229
224
  }
230
225
  const isFromUntitledWorkspace = isUntitledWorkspace(configPathURI, this.environmentService);
231
226
  const raw = await this.fileService.readFile(configPathURI);
232
- const newRawWorkspaceContents = rewriteWorkspaceFileForNewLocation(( raw.value.toString()), configPathURI, isFromUntitledWorkspace, targetConfigPathURI, this.uriIdentityService.extUri);
227
+ const newRawWorkspaceContents = rewriteWorkspaceFileForNewLocation(( (raw.value.toString())), configPathURI, isFromUntitledWorkspace, targetConfigPathURI, this.uriIdentityService.extUri);
233
228
  await this.textFileService.create([{ resource: targetConfigPathURI, value: newRawWorkspaceContents, options: { overwrite: true } }]);
234
229
  await this.trustWorkspaceConfiguration(targetConfigPathURI);
235
230
  }
@@ -259,25 +254,21 @@ let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
259
254
  }
260
255
  onInvalidWorkspaceConfigurationFileError() {
261
256
  const message = ( localizeWithPath(
262
- 'vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService',
263
- 'errorInvalidTaskConfiguration',
257
+ _moduleId,
258
+ 2,
264
259
  "Unable to write into workspace configuration file. Please open the file to correct errors/warnings in it and try again."
265
260
  ));
266
261
  this.askToOpenWorkspaceConfigurationFile(message);
267
262
  }
268
263
  askToOpenWorkspaceConfigurationFile(message) {
269
264
  this.notificationService.prompt(Severity$1.Error, message, [{
270
- label: ( localizeWithPath(
271
- 'vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService',
272
- 'openWorkspaceConfigurationFile',
273
- "Open Workspace Configuration"
274
- )),
265
+ label: ( localizeWithPath(_moduleId, 3, "Open Workspace Configuration")),
275
266
  run: () => this.commandService.executeCommand('workbench.action.openWorkspaceConfigFile')
276
267
  }]);
277
268
  }
278
269
  async doEnterWorkspace(workspaceUri) {
279
270
  if (!!this.environmentService.extensionTestsLocationURI) {
280
- throw new Error('Entering a new workspace is not possible in tests.');
271
+ throw ( (new Error('Entering a new workspace is not possible in tests.')));
281
272
  }
282
273
  const workspace = await this.workspacesService.getWorkspaceIdentifier(workspaceUri);
283
274
  if (this.contextService.getWorkbenchState() === 2 ) {
@@ -293,9 +284,9 @@ let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
293
284
  return this.doCopyWorkspaceSettings(toWorkspace);
294
285
  }
295
286
  doCopyWorkspaceSettings(toWorkspace, filter) {
296
- const configurationProperties = ( Registry.as(Extensions.Configuration)).getConfigurationProperties();
287
+ const configurationProperties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties();
297
288
  const targetWorkspaceConfiguration = {};
298
- for (const key of ( this.configurationService.keys()).workspace) {
289
+ for (const key of ( (this.configurationService.keys())).workspace) {
299
290
  if (configurationProperties[key]) {
300
291
  if (filter && !filter(configurationProperties[key])) {
301
292
  continue;
@@ -318,23 +309,23 @@ let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
318
309
  return undefined;
319
310
  }
320
311
  };
321
- AbstractWorkspaceEditingService = ( __decorate([
322
- ( __param(0, IJSONEditingService)),
323
- ( __param(1, IWorkspaceContextService)),
324
- ( __param(2, IWorkbenchConfigurationService)),
325
- ( __param(3, INotificationService)),
326
- ( __param(4, ICommandService)),
327
- ( __param(5, IFileService)),
328
- ( __param(6, ITextFileService)),
329
- ( __param(7, IWorkspacesService)),
330
- ( __param(8, IWorkbenchEnvironmentService)),
331
- ( __param(9, IFileDialogService)),
332
- ( __param(10, IDialogService)),
333
- ( __param(11, IHostService)),
334
- ( __param(12, IUriIdentityService)),
335
- ( __param(13, IWorkspaceTrustManagementService)),
336
- ( __param(14, IUserDataProfilesService)),
337
- ( __param(15, IUserDataProfileService))
338
- ], AbstractWorkspaceEditingService));
312
+ AbstractWorkspaceEditingService = ( (__decorate([
313
+ ( (__param(0, IJSONEditingService))),
314
+ ( (__param(1, IWorkspaceContextService))),
315
+ ( (__param(2, IWorkbenchConfigurationService))),
316
+ ( (__param(3, INotificationService))),
317
+ ( (__param(4, ICommandService))),
318
+ ( (__param(5, IFileService))),
319
+ ( (__param(6, ITextFileService))),
320
+ ( (__param(7, IWorkspacesService))),
321
+ ( (__param(8, IWorkbenchEnvironmentService))),
322
+ ( (__param(9, IFileDialogService))),
323
+ ( (__param(10, IDialogService))),
324
+ ( (__param(11, IHostService))),
325
+ ( (__param(12, IUriIdentityService))),
326
+ ( (__param(13, IWorkspaceTrustManagementService))),
327
+ ( (__param(14, IUserDataProfilesService))),
328
+ ( (__param(15, IUserDataProfileService)))
329
+ ], AbstractWorkspaceEditingService)));
339
330
 
340
331
  export { AbstractWorkspaceEditingService };
@@ -1,29 +0,0 @@
1
- import { IDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
2
- import { URI } from 'vscode/vscode/vs/base/common/uri';
3
- import { IEditorOverrideServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
4
- import { IConfigurationRegistry } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
5
- export { ConfigurationScope, IConfigurationDefaults, IConfigurationNode } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
6
- import { IFileWriteOptions } from 'vscode/vscode/vs/platform/files/common/files';
7
- import { IAnyWorkspaceIdentifier } from 'vscode/vscode/vs/platform/workspace/common/workspace';
8
- export { IAnyWorkspaceIdentifier, IEmptyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vscode/vscode/vs/platform/workspace/common/workspace';
9
-
10
- declare const defaultUserConfigurationFile: URI;
11
- /**
12
- * Should be called only BEFORE the service are initialized to initialize the file on the filesystem before the configuration service initializes
13
- */
14
- declare function initUserConfiguration(configurationJson: string, options?: Partial<IFileWriteOptions>, file?: URI): Promise<void>;
15
- /**
16
- * Can be called at any time after the services are initialized to update the user configuration
17
- */
18
- declare function updateUserConfiguration(configurationJson: string): Promise<void>;
19
- declare function getUserConfiguration(): Promise<string>;
20
- declare function onUserConfigurationChange(callback: () => void): IDisposable;
21
- declare const configurationRegistry: IConfigurationRegistry;
22
- declare function reinitializeWorkspace(workspace: IAnyWorkspaceIdentifier): Promise<void>;
23
- declare function getServiceOverride(): IEditorOverrideServices;
24
- /**
25
- * @deprecated Provide workspace via the services `initialize` function `configuration.workspaceProvider` parameter
26
- */
27
- declare function getServiceOverride(defaultWorkspace?: URI | IAnyWorkspaceIdentifier): IEditorOverrideServices;
28
-
29
- export { configurationRegistry, getServiceOverride as default, defaultUserConfigurationFile, getUserConfiguration, initUserConfiguration, onUserConfigurationChange, reinitializeWorkspace, updateUserConfiguration };