445
edits = setProperty(content, [key], value, formattingOptions);
446
} else {
447
>
edits = getEditToInsertAtLocation(content, key, value, location, tree, formattingOptions).map(edit => withFormatting(content, edit, formattingOptions)[0]);
settingsMerge.ts
448
>
}
449
return applyEdits(content, edits);
450
}
451
452
>
function getEditToInsertAtLocation(content: string, key: string, value: any, location: InsertLocation, tree: INode[], formattingOptions: FormattingOptions): Edit[] {
settingsMerge.ts
453
>
const newProperty = `${JSON.stringify(key)}: ${JSON.stringify(value)}`;
454
>
const eol = getEOL(formattingOptions, content);
455
>
const node = tree[location.index];
456
>
457
>
if (location.insertAfter) {
458
459
const edits: Edit[] = [];