src/vs/workbench/services/configuration/common/configurationEditingService.ts/ConfigurationEditingService/doWriteConfiguration
class ConfigurationEditingService:	private async doWriteConfiguration(operation: IConfigurationEditOperation, options: ConfigurationEditingOptions): Promise<void> {
		await this.validate(operation.target, operation, !options.ignoreDirtyFile, options.scopes || {});
		const resource: URI = operation.resource!;
		const reference = await this.resolveModelReference(resource);
		try {
			const formattingOptions = this.getFormattingOptions(reference.object.textEditorModel);
			if (this.uriIdentityService.extUri.isEqual(resource, this.environmentService.settingsResource)) {
				await this.userConfigurationFileService.updateSettings({ path: operation.jsonPath, value: operation.value }, formattingOptions);
			} else {
				await this.updateConfiguration(operation, reference.object.textEditorModel, formattingOptions);
			}
		} catch (error) {
			if ((<Error>error).message === UserConfigurationErrorCode.ERROR_INVALID_FILE) {
				throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION, operation.target, operation);
			}
			if ((<Error>error).message === UserConfigurationErrorCode.ERROR_FILE_MODIFIED_SINCE || (<FileOperationError>error).fileOperationResult === FileOperationResult.FILE_MODIFIED_SINCE) {
				throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE, operation.target, operation);
			}
			throw error;
		} finally {
			reference.dispose();
		}
	}