138
configValue.workspaceFolderValue !== undefined;
139
}
141
>
export interface IConfigurationUpdateOptions {
142
>
/**
143
>
* If `true`, do not notifies the error to user by showing the message box. Default is `false`.
144
>
*/
145
>
donotNotifyError?: boolean;
146
>
/**
147
>
* How to handle dirty file when updating the configuration.
148
>
*/
149
>
handleDirtyFile?: 'save' | 'revert';
150
>
}
151
>
152
>
export interface IConfigurationService {
153
>
readonly _serviceBrand: undefined;
154
>
155
>
readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
156
>
157
>
getConfigurationData(): IConfigurationData | null;
158
>
159
>
/**
160
>
* Fetches the value of the section for the given overrides.
161
>
* Value can be of native type or an object keyed off the section name.
162
>
*
163
>
* @param section - Section of the configuration. Can be `null` or `undefined`.
164
>
* @param overrides - Overrides that has to be applied while fetching
165
>
*
166
>
*/
167
>
getValue<T>(): T;
168
>
getValue<T>(section: string): T;
169
>
getValue<T>(overrides: IConfigurationOverrides): T;
170
>
getValue<T>(section: string, overrides: IConfigurationOverrides): T;
171
>
172
>
/**
173
>
* Update a configuration value.
174
>
*
175
>
* Use `target` to update the configuration in a specific `ConfigurationTarget`.
176
>
*
177
>
* Use `overrides` to update the configuration for a resource or for override identifiers or both.
178
>
*
179
>
* Passing a resource through overrides will update the configuration in the workspace folder containing that resource.
180
>
*
181
>
* *Note 1:* Updating configuration to a default value will remove the configuration from the requested target. If not target is passed, it will be removed from all writeable targets.
182
>
*
183
>
* *Note 2:* Use `undefined` value to remove the configuration from the given target. If not target is passed, it will be removed from all writeable targets.
184
>
*
185
>
* Use `donotNotifyError` and set it to `true` to surpresss errors.
186
>
*
187
>
* @param key setting to be updated
188
>
* @param value The new value
189
>
*/
190
>
updateValue(key: string, value: unknown): Promise<void>;
191
>
updateValue(key: string, value: unknown, target: ConfigurationTarget): Promise<void>;
192
>
updateValue(key: string, value: unknown, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides): Promise<void>;
193
>
updateValue(key: string, value: unknown, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides, target: ConfigurationTarget, options?: IConfigurationUpdateOptions): Promise<void>;
194
>
195
>
inspect<T>(key: string, overrides?: IConfigurationOverrides): IConfigurationValue<Readonly<T>>;
196
>
197
>
reloadConfiguration(target?: ConfigurationTarget | IWorkspaceFolder): Promise<void>;
198
>
199
>
keys(): {
200
>
default: string[];
201
>
policy: string[];
202
>
user: string[];
203
>
workspace: string[];
204
>
workspaceFolder: string[];
205
>
memory?: string[];
206
>
};
207
>
}
208
>
209
>
export interface IConfigurationModel {
210
>
contents: IStringDictionary<unknown>;
211
>
keys: string[];
212
>
overrides: IOverrides[];
213
>
raw?: ReadonlyArray<IStringDictionary<unknown>> | IStringDictionary<unknown>;
214
>
}
215
>
216
>
export interface IOverrides {
217
>
keys: string[];
218
>
contents: IStringDictionary<unknown>;
219
>
identifiers: string[];
220
>
}
221
>
222
>
export interface IConfigurationData {
223
>
defaults: IConfigurationModel;
224
>
policy: IConfigurationModel;
225
>
application: IConfigurationModel;
226
>
userLocal: IConfigurationModel;
227
>
userRemote: IConfigurationModel;
228
>
workspace: IConfigurationModel;
229
>
folders: [UriComponents, IConfigurationModel][];
230
>
}
231
>
232
>
export interface IConfigurationCompareResult {
233
>
added: string[];
234
>
removed: string[];
235
>
updated: string[];
236
>
overrides: [string, string[]][];
237
>
}
238
>
239
>
export function toValuesTree(properties: IStringDictionary<unknown>, conflictReporter: (message: string) => void): IStringDictionary<unknown> {
240
const root = Object.create(null);
241