From d021842fa1ff8dcc76f00e5b5a1950134edb11c9 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 21 Sep 2023 23:49:22 +0300 Subject: [PATCH] Properly log pre-lsp prettier_server events --- crates/prettier/src/prettier_server.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/prettier/src/prettier_server.js b/crates/prettier/src/prettier_server.js index e5c131cc00..001adca474 100644 --- a/crates/prettier/src/prettier_server.js +++ b/crates/prettier/src/prettier_server.js @@ -5,17 +5,17 @@ const { once } = require('events'); const prettierContainerPath = process.argv[2]; if (prettierContainerPath == null || prettierContainerPath.length == 0) { - process.stderr.write(`Prettier path argument was not specified or empty.\nUsage: ${process.argv[0]} ${process.argv[1]} prettier/path`); + process.stderr.write(`Prettier path argument was not specified or empty.\nUsage: ${process.argv[0]} ${process.argv[1]} prettier/path\n`); process.exit(1); } fs.stat(prettierContainerPath, (err, stats) => { if (err) { - process.stderr.write(`Path '${prettierContainerPath}' does not exist.`); + process.stderr.write(`Path '${prettierContainerPath}' does not exist\n`); process.exit(1); } if (!stats.isDirectory()) { - process.stderr.write(`Path '${prettierContainerPath}' exists but is not a directory.`); + process.stderr.write(`Path '${prettierContainerPath}' exists but is not a directory\n`); process.exit(1); } }); @@ -27,10 +27,10 @@ const prettierPath = path.join(prettierContainerPath, 'node_modules/prettier'); try { prettier = await loadPrettier(prettierPath); } catch (e) { - process.stderr.write(`Failed to load prettier: ${e}`); + process.stderr.write(`Failed to load prettier: ${e}\n`); process.exit(1); } - process.stderr.write("Prettier loadded successfully."); + process.stderr.write("Prettier loadded successfully\n"); process.stdin.resume(); handleBuffer(prettier); })()