import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service"; import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service"; import { IConfigurationUpdateOptions, IConfigurationUpdateOverrides } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration"; import { IWorkbenchConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configuration/common/configuration.service"; import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service"; import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service"; import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service"; import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service"; import { IPreferencesService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service"; import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service"; import { IUserDataProfileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service"; import { IUserDataProfilesService } from "@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service"; import { ErrorNoTelemetry } from "@codingame/monaco-vscode-api/vscode/vs/base/common/errors"; import { IFilesConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service"; export declare enum ConfigurationEditingErrorCode { /** * Error when trying to write a configuration key that is not registered. */ ERROR_UNKNOWN_KEY = 0, /** * Error when trying to write an application setting into workspace settings. */ ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION = 1, /** * Error when trying to write a machne setting into workspace settings. */ ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE = 2, /** * Error when trying to write an invalid folder configuration key to folder settings. */ ERROR_INVALID_FOLDER_CONFIGURATION = 3, /** * Error when trying to write to user target but not supported for provided key. */ ERROR_INVALID_USER_TARGET = 4, /** * Error when trying to write to user target but not supported for provided key. */ ERROR_INVALID_WORKSPACE_TARGET = 5, /** * Error when trying to write a configuration key to folder target */ ERROR_INVALID_FOLDER_TARGET = 6, /** * Error when trying to write to language specific setting but not supported for preovided key */ ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION = 7, /** * Error when trying to write to the workspace configuration without having a workspace opened. */ ERROR_NO_WORKSPACE_OPENED = 8, /** * Error when trying to write and save to the configuration file while it is dirty in the editor. */ ERROR_CONFIGURATION_FILE_DIRTY = 9, /** * Error when trying to write and save to the configuration file while it is not the latest in the disk. */ ERROR_CONFIGURATION_FILE_MODIFIED_SINCE = 10, /** * Error when trying to write to a configuration file that contains JSON errors. */ ERROR_INVALID_CONFIGURATION = 11, /** * Error when trying to write a policy configuration */ ERROR_POLICY_CONFIGURATION = 12, /** * Internal Error. */ ERROR_INTERNAL = 13 } export declare class ConfigurationEditingError extends ErrorNoTelemetry { code: ConfigurationEditingErrorCode; constructor(message: string, code: ConfigurationEditingErrorCode); } export interface IConfigurationValue { key: string; value: unknown; } export interface IConfigurationEditingOptions extends IConfigurationUpdateOptions { /** * Scope of configuration to be written into. */ scopes?: IConfigurationUpdateOverrides; } export declare enum EditableConfigurationTarget { USER_LOCAL = 1, USER_REMOTE = 2, WORKSPACE = 3, WORKSPACE_FOLDER = 4 } export declare class ConfigurationEditing { private readonly remoteSettingsResource; private readonly configurationService; private readonly contextService; private readonly userDataProfileService; private readonly userDataProfilesService; private readonly fileService; private readonly textModelResolverService; private readonly textFileService; private readonly notificationService; private readonly preferencesService; private readonly editorService; private readonly uriIdentityService; private readonly filesConfigurationService; _serviceBrand: undefined; private queue; 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, filesConfigurationService: IFilesConfigurationService); writeConfiguration(target: EditableConfigurationTarget, value: IConfigurationValue, options?: IConfigurationEditingOptions): Promise; private doWriteConfiguration; private updateConfiguration; private save; private applyEditsToBuffer; private getEdits; private getFormattingOptions; private onError; private onInvalidConfigurationError; private onConfigurationFileDirtyError; private openSettings; private openFile; private toConfigurationEditingError; private toErrorMessage; private stringifyTarget; private defaultResourceValue; private resolveModelReference; private hasParseErrors; private validate; private getConfigurationEditOperation; private isWorkspaceConfigurationResource; private getConfigurationFileResource; }