mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
[json] "Format document" on a large JSON file adds extra bracket Fixes #91125
This commit is contained in:
parent
f8188579a3
commit
cfc07ec7aa
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue