Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Start message numbering during prettier init, log error message text

Kirill Bulatov29a32039bab7
diff --git a/crates/prettier/src/prettier_server.js b/crates/prettier/src/prettier_server.js
index a56c220f208..9967aec50f4 100644
--- a/crates/prettier/src/prettier_server.js
+++ b/crates/prettier/src/prettier_server.js
@@ -55,8 +55,11 @@ async function handleBuffer(prettier) {
}
// allow concurrent request handling by not `await`ing the message handling promise (async function)
handleMessage(message, prettier).catch(e => {
- sendResponse({ id: message.id, ...makeError(`error during message handling: ${e}`) });
- });
+ const errorMessage = message;
+ if ((errorMessage.params || {}).text !== undefined) {
+ errorMessage.params.text = "..snip..";
+ }
+ sendResponse({ id: message.id, ...makeError(`error during message '${JSON.stringify(errorMessage)}' handling: ${e}`) }); });
}
}
@@ -172,7 +175,7 @@ async function handleMessage(message, prettier) {
sendResponse({ id, result: null });
} else if (method === 'initialize') {
sendResponse({
- id,
+ id: id || 0,
result: {
"capabilities": {}
}