Skip to content
Snippets Groups Projects
Commit db813d51 authored by Liangliang Zhu's avatar Liangliang Zhu
Browse files

fix #4474

parent b3888802
Branches flicker-free-refresh
No related tags found
No related merge requests found
...@@ -43,9 +43,13 @@ async function formatDocument(document: vscode.TextDocument, range?: vscode.Rang ...@@ -43,9 +43,13 @@ async function formatDocument(document: vscode.TextDocument, range?: vscode.Rang
}) })
}) })
process.stdin?.write(document.getText(range)) // write the document to the process, and add a newline at the end
process.stdin?.write(document.getText(range)+'\n')
process.stdin?.end() process.stdin?.end()
const edits = await promise const edits = await promise
// remove extra newline at the end
if (edits) {
edits.newText = edits.newText.replace(/\n$/, '')
}
return edits return edits
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment