@codingame/monaco-vscode-configuration-service-override 11.1.2 → 12.0.0
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/index.d.ts +29 -2
- package/index.js +138 -1
- package/package.json +27 -8
- package/vscode/src/vs/editor/common/services/textResourceConfigurationService.d.ts +26 -0
- package/vscode/src/vs/editor/common/services/textResourceConfigurationService.js +13 -11
- package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.d.ts +1 -0
- package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.js +82 -79
- package/vscode/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.js +31 -32
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.d.ts +130 -0
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.js +18 -16
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.d.ts +144 -0
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +182 -186
- package/vscode/src/vs/workbench/services/configuration/common/configurationCache.d.ts +16 -0
- package/vscode/src/vs/workbench/services/configuration/common/configurationCache.js +3 -1
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.d.ts +86 -0
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.js +219 -194
- package/vscode/src/vs/workbench/services/configuration/common/configurationModels.d.ts +43 -0
- package/vscode/src/vs/workbench/services/configuration/common/configurationModels.js +1 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.d.ts +37 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +30 -26
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.d.ts +13 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +3 -1
- package/vscode/src/vs/workbench/services/textresourceProperties/common/textResourcePropertiesService.d.ts +16 -0
- package/vscode/src/vs/workbench/services/textresourceProperties/common/textResourcePropertiesService.js +8 -5
- package/vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.d.ts +64 -0
- package/vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +54 -53
- package/vscode/src/vs/workbench/services/workspaces/browser/workspacesService.d.ts +39 -0
- package/vscode/src/vs/workbench/services/workspaces/browser/workspacesService.js +15 -11
- package/configuration.js +0 -138
- package/tools.js +0 -44
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IConfigurationCache, ConfigurationKey } from "@codingame/monaco-vscode-37e80bf5-92f5-5e4c-8b6d-98e0bb89dbef-common/vscode/vs/workbench/services/configuration/common/configuration";
|
|
2
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
3
|
+
import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
|
|
4
|
+
import { IEnvironmentService } from "vscode/vscode/vs/platform/environment/common/environment.service";
|
|
5
|
+
export declare class ConfigurationCache implements IConfigurationCache {
|
|
6
|
+
private readonly donotCacheResourcesWithSchemes;
|
|
7
|
+
private readonly fileService;
|
|
8
|
+
private readonly cacheHome;
|
|
9
|
+
private readonly cachedConfigurations;
|
|
10
|
+
constructor(donotCacheResourcesWithSchemes: string[], environmentService: IEnvironmentService, fileService: IFileService);
|
|
11
|
+
needsCaching(resource: URI): boolean;
|
|
12
|
+
read(key: ConfigurationKey): Promise<string>;
|
|
13
|
+
write(key: ConfigurationKey, content: string): Promise<void>;
|
|
14
|
+
remove(key: ConfigurationKey): Promise<void>;
|
|
15
|
+
private getCachedConfiguration;
|
|
16
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
import { FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
|
|
1
3
|
import { joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
2
4
|
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
3
5
|
import { Queue } from 'vscode/vscode/vs/base/common/async';
|
|
@@ -60,7 +62,7 @@ class CachedConfiguration {
|
|
|
60
62
|
await this.queue.queue(() => this.fileService.del(this.cachedConfigurationFolderResource, { recursive: true, useTrash: false }));
|
|
61
63
|
}
|
|
62
64
|
catch (error) {
|
|
63
|
-
if (error.fileOperationResult !==
|
|
65
|
+
if (error.fileOperationResult !== FileOperationResult.FILE_NOT_FOUND) {
|
|
64
66
|
throw error;
|
|
65
67
|
}
|
|
66
68
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
2
|
+
import { IWorkspaceContextService } from "vscode/vscode/vs/platform/workspace/common/workspace.service";
|
|
3
|
+
import { ITextFileService } from "vscode/vscode/vs/workbench/services/textfile/common/textfiles.service";
|
|
4
|
+
import { IConfigurationUpdateOptions, IConfigurationUpdateOverrides } from "vscode/vscode/vs/platform/configuration/common/configuration";
|
|
5
|
+
import { IWorkbenchConfigurationService } from "@codingame/monaco-vscode-422642f2-7e3a-5c1c-9e1e-1d3ef1817346-common/vscode/vs/workbench/services/configuration/common/configuration.service";
|
|
6
|
+
import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
|
|
7
|
+
import { ITextModelService } from "vscode/vscode/vs/editor/common/services/resolverService";
|
|
8
|
+
import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
9
|
+
import { INotificationService } from "vscode/vscode/vs/platform/notification/common/notification.service";
|
|
10
|
+
import { IPreferencesService } from "vscode/vscode/vs/workbench/services/preferences/common/preferences.service";
|
|
11
|
+
import { IUriIdentityService } from "vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
12
|
+
import { IUserDataProfileService } from "vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service";
|
|
13
|
+
import { IUserDataProfilesService } from "vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service";
|
|
14
|
+
import { ErrorNoTelemetry } from "vscode/vscode/vs/base/common/errors";
|
|
15
|
+
export declare enum ConfigurationEditingErrorCode {
|
|
16
|
+
ERROR_UNKNOWN_KEY = 0,
|
|
17
|
+
ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION = 1,
|
|
18
|
+
ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE = 2,
|
|
19
|
+
ERROR_INVALID_FOLDER_CONFIGURATION = 3,
|
|
20
|
+
ERROR_INVALID_USER_TARGET = 4,
|
|
21
|
+
ERROR_INVALID_WORKSPACE_TARGET = 5,
|
|
22
|
+
ERROR_INVALID_FOLDER_TARGET = 6,
|
|
23
|
+
ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION = 7,
|
|
24
|
+
ERROR_NO_WORKSPACE_OPENED = 8,
|
|
25
|
+
ERROR_CONFIGURATION_FILE_DIRTY = 9,
|
|
26
|
+
ERROR_CONFIGURATION_FILE_MODIFIED_SINCE = 10,
|
|
27
|
+
ERROR_INVALID_CONFIGURATION = 11,
|
|
28
|
+
ERROR_POLICY_CONFIGURATION = 12,
|
|
29
|
+
ERROR_INTERNAL = 13
|
|
30
|
+
}
|
|
31
|
+
export declare class ConfigurationEditingError extends ErrorNoTelemetry {
|
|
32
|
+
code: ConfigurationEditingErrorCode;
|
|
33
|
+
constructor(message: string, code: ConfigurationEditingErrorCode);
|
|
34
|
+
}
|
|
35
|
+
export interface IConfigurationValue {
|
|
36
|
+
key: string;
|
|
37
|
+
value: any;
|
|
38
|
+
}
|
|
39
|
+
export interface IConfigurationEditingOptions extends IConfigurationUpdateOptions {
|
|
40
|
+
scopes?: IConfigurationUpdateOverrides;
|
|
41
|
+
}
|
|
42
|
+
export declare enum EditableConfigurationTarget {
|
|
43
|
+
USER_LOCAL = 1,
|
|
44
|
+
USER_REMOTE = 2,
|
|
45
|
+
WORKSPACE = 3,
|
|
46
|
+
WORKSPACE_FOLDER = 4
|
|
47
|
+
}
|
|
48
|
+
export declare class ConfigurationEditing {
|
|
49
|
+
private readonly remoteSettingsResource;
|
|
50
|
+
private readonly configurationService;
|
|
51
|
+
private readonly contextService;
|
|
52
|
+
private readonly userDataProfileService;
|
|
53
|
+
private readonly userDataProfilesService;
|
|
54
|
+
private readonly fileService;
|
|
55
|
+
private readonly textModelResolverService;
|
|
56
|
+
private readonly textFileService;
|
|
57
|
+
private readonly notificationService;
|
|
58
|
+
private readonly preferencesService;
|
|
59
|
+
private readonly editorService;
|
|
60
|
+
private readonly uriIdentityService;
|
|
61
|
+
_serviceBrand: undefined;
|
|
62
|
+
private queue;
|
|
63
|
+
constructor(remoteSettingsResource: URI | null, configurationService: IWorkbenchConfigurationService, contextService: IWorkspaceContextService, userDataProfileService: IUserDataProfileService, userDataProfilesService: IUserDataProfilesService, fileService: IFileService, textModelResolverService: ITextModelService, textFileService: ITextFileService, notificationService: INotificationService, preferencesService: IPreferencesService, editorService: IEditorService, uriIdentityService: IUriIdentityService);
|
|
64
|
+
writeConfiguration(target: EditableConfigurationTarget, value: IConfigurationValue, options?: IConfigurationEditingOptions): Promise<void>;
|
|
65
|
+
private doWriteConfiguration;
|
|
66
|
+
private updateConfiguration;
|
|
67
|
+
private save;
|
|
68
|
+
private applyEditsToBuffer;
|
|
69
|
+
private getEdits;
|
|
70
|
+
private getFormattingOptions;
|
|
71
|
+
private onError;
|
|
72
|
+
private onInvalidConfigurationError;
|
|
73
|
+
private onConfigurationFileDirtyError;
|
|
74
|
+
private openSettings;
|
|
75
|
+
private openFile;
|
|
76
|
+
private toConfigurationEditingError;
|
|
77
|
+
private toErrorMessage;
|
|
78
|
+
private stringifyTarget;
|
|
79
|
+
private defaultResourceValue;
|
|
80
|
+
private resolveModelReference;
|
|
81
|
+
private hasParseErrors;
|
|
82
|
+
private validate;
|
|
83
|
+
private getConfigurationEditOperation;
|
|
84
|
+
private isWorkspaceConfigurationResource;
|
|
85
|
+
private getConfigurationFileResource;
|
|
86
|
+
}
|