From 3dacba5057369714c67b259071f2c36f919d92c6 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:04:54 -0700 Subject: perf(lsp): Only deserialize response from `op_respond` once (#23349) Previously we were deserializing it twice - once to `serde_json::Value`, and then again from the `serde_json::Value` to a concrete type --- cli/tsc/99_main_compiler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/tsc/99_main_compiler.js') diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index c6beddf32..274fc1cca 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -1021,14 +1021,14 @@ delete Object.prototype.__proto__; } /** - * @param {number} id + * @param {number} _id * @param {any} data */ // TODO(bartlomieju): this feels needlessly generic, both type chcking // and language server use it with inefficient serialization. Id is not used // anyway... - function respond(id, data = null) { - ops.op_respond({ id, data }); + function respond(_id, data = null) { + ops.op_respond(JSON.stringify(data)); } function serverRequest(id, method, args) { -- cgit v1.2.3