lsp: Fix format of JSON-RPC content part ending with \r\n

This commit is contained in:
Luoyayu 2024-12-07 07:36:14 +00:00 committed by James Westman
parent 6acf0fe5a0
commit 778a979714

View file

@ -149,7 +149,7 @@ class LanguageServer:
def _send(self, data):
data["jsonrpc"] = "2.0"
line = json.dumps(data, separators=(",", ":")) + "\r\n"
line = json.dumps(data, separators=(",", ":"))
printerr("output: " + line)
sys.stdout.write(
f"Content-Length: {len(line.encode())}\r\nContent-Type: application/vscode-jsonrpc; charset=utf-8\r\n\r\n{line}"