@codingame/monaco-vscode-configuration-service-override 1.83.7 → 1.83.8

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.
@@ -20,6 +20,10 @@ declare function getUserConfiguration(): Promise<string>;
20
20
  declare function onUserConfigurationChange(callback: () => void): Disposable;
21
21
  declare const configurationRegistry: IConfigurationRegistry;
22
22
  declare function reinitializeWorkspace(workspace: IAnyWorkspaceIdentifier): Promise<void>;
23
- declare function getServiceOverride(defaultWorkspace: URI | IAnyWorkspaceIdentifier): IEditorOverrideServices;
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;
24
28
 
25
29
  export { configurationRegistry, getServiceOverride as default, defaultUserConfigurationFile, getUserConfiguration, initUserConfiguration, onUserConfigurationChange, reinitializeWorkspace, updateUserConfiguration };
package/configuration.js CHANGED
@@ -34,6 +34,7 @@ import getServiceOverride$3, { initFile } from 'vscode/service-override/files';
34
34
  import { memoizedConstructor, unsupported } from './tools.js';
35
35
  import { registerServiceInitializePreParticipant } from 'vscode/lifecycle';
36
36
  import { getService } from './services.js';
37
+ import { getWorkspaceIdentifier } from 'vscode/workbench';
37
38
 
38
39
  const defaultUserConfigurationFile = ( URI.from({ scheme: Schemas.vscodeUserData, path: '/User/settings.json' }));
39
40
  async function initUserConfiguration(configurationJson, options, file = defaultUserConfigurationFile) {
@@ -78,19 +79,20 @@ class MonacoWorkspaceEditingService extends AbstractWorkspaceEditingService {
78
79
  this.enterWorkspace = unsupported;
79
80
  }
80
81
  }
81
- let _defaultWorkspace = URI.file('/workspace');
82
+ let _defaultWorkspace;
82
83
  registerServiceInitializePreParticipant(async (accessor) => {
83
84
  const workspaceService = accessor.get(IWorkspaceContextService);
84
85
  workspaceService.acquireInstantiationService(accessor.get(IInstantiationService));
85
- if (URI.isUri(_defaultWorkspace)) {
86
- const configPath = _defaultWorkspace.with({ path: '/workspace.code-workspace' });
86
+ const workspace = _defaultWorkspace ?? getWorkspaceIdentifier();
87
+ if (URI.isUri(workspace)) {
88
+ const configPath = workspace.with({ path: '/workspace.code-workspace' });
87
89
  try {
88
90
  const fileService = accessor.get(IFileService);
89
- await fileService.createFolder(_defaultWorkspace);
91
+ await fileService.createFolder(workspace);
90
92
  await fileService.writeFile(configPath, VSBuffer.fromString(JSON.stringify({
91
93
  folders: [
92
94
  {
93
- path: _defaultWorkspace.path
95
+ path: workspace.path
94
96
  }
95
97
  ]
96
98
  })));
@@ -103,7 +105,7 @@ registerServiceInitializePreParticipant(async (accessor) => {
103
105
  });
104
106
  }
105
107
  else {
106
- await workspaceService.initialize(_defaultWorkspace);
108
+ await workspaceService.initialize(workspace);
107
109
  }
108
110
  });
109
111
  const MemoizedInjectedConfigurationService = memoizedConstructor(InjectedConfigurationService);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-configuration-service-override",
3
- "version": "1.83.7",
3
+ "version": "1.83.8",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.83.7",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.83.8",
22
22
  "monaco-editor": "0.44.0"
23
23
  }
24
24
  }
package/services.js CHANGED
@@ -11,6 +11,7 @@ import 'vscode/service-override/extensions';
11
11
  import 'vscode/service-override/files';
12
12
  import 'vscode/service-override/quickaccess';
13
13
  import { serviceInitializedBarrier } from 'vscode/lifecycle';
14
+ import 'vscode/workbench';
14
15
  export { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
15
16
  export { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
16
17
  export { INotificationService, NeverShowAgainScope, NoOpNotification, NoOpProgress, NotificationPriority, NotificationsFilter } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';