Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3

This commit is contained in:
ADS Merger
2020-03-11 04:19:23 +00:00
parent 16fab722d5
commit 4c3e48773d
880 changed files with 20441 additions and 11232 deletions

View File

@@ -41,18 +41,18 @@ export class JSONEditingService implements IJSONEditingService {
private async doWriteConfiguration(resource: URI, values: IJSONValue[], save: boolean): Promise<void> {
const reference = await this.resolveAndValidate(resource, save);
await this.writeToBuffer(reference.object.textEditorModel, values);
await this.writeToBuffer(reference.object.textEditorModel, values, save);
reference.dispose();
}
private async writeToBuffer(model: ITextModel, values: IJSONValue[]): Promise<any> {
private async writeToBuffer(model: ITextModel, values: IJSONValue[], save: boolean): Promise<any> {
let hasEdits: boolean = false;
for (const value of values) {
const edit = this.getEdits(model, value)[0];
hasEdits = this.applyEditsToBuffer(edit, model);
}
if (hasEdits) {
if (hasEdits && save) {
return this.textFileService.save(model.uri);
}
}