提交 cfc07ec7 编写于 作者: M Martin Aeschlimann

[json] "Format document" on a large JSON file adds extra bracket Fixes #91125

上级 f8188579
......@@ -450,7 +450,7 @@ connection.onDocumentRangeFormatting((formatParams, token) => {
const edits = languageService.format(document, formatParams.range, formatParams.options);
if (edits.length > formatterMaxNumberOfEdits) {
const newText = TextDocument.applyEdits(document, edits);
return [TextEdit.replace(Range.create(Position.create(0, 0), document.positionAt(document.getText().length - 1)), newText)];
return [TextEdit.replace(Range.create(Position.create(0, 0), document.positionAt(document.getText().length)), newText)];
}
return edits;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册