Merge from vscode 4d91d96e5e121b38d33508cdef17868bab255eae

This commit is contained in:
ADS Merger
2020-06-18 04:32:54 +00:00
committed by AzureDataStudio
parent a971aee5bd
commit 5e7071e466
1002 changed files with 24201 additions and 13193 deletions

View File

@@ -75,10 +75,10 @@ export class JSONEditingService implements IJSONEditingService {
private getEdits(model: ITextModel, configurationValue: IJSONValue): Edit[] {
const { tabSize, insertSpaces } = model.getOptions();
const eol = model.getEOL();
const { key, value } = configurationValue;
const { path, value } = configurationValue;
// Without key, the entire settings file is being replaced, so we just use JSON.stringify
if (!key) {
// With empty path the entire file is being replaced, so we just use JSON.stringify
if (!path.length) {
const content = JSON.stringify(value, null, insertSpaces ? strings.repeat(' ', tabSize) : '\t');
return [{
content,
@@ -87,7 +87,7 @@ export class JSONEditingService implements IJSONEditingService {
}];
}
return setProperty(model.getValue(), [key], value, { tabSize, insertSpaces, eol });
return setProperty(model.getValue(), path, value, { tabSize, insertSpaces, eol });
}
private async resolveModelReference(resource: URI): Promise<IReference<IResolvedTextEditorModel>> {