mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
[json] "Format document" on a large JSON file adds extra bracket Fixes #91125
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user