提交 b7da8414 编写于 作者: S Sandeep Somavarapu

#18095 json edit

- Fix remove last item from the array if there is a comment in the beginning
上级 919254bc
......@@ -104,7 +104,8 @@ export function setProperty(text: string, path: JSONPath, value: any, formatting
// last item
let previous = parent.children[removalIndex - 1];
let offset = previous.offset + previous.length;
edit = { offset, length: parent.length - 2 - offset, content: '' };
let parentEndOffset = parent.offset + parent.length;
edit = { offset, length: parentEndOffset - 2 - offset, content: '' };
} else {
edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: '' };
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册