From a21f44b27c3fc83cc9ff9f22e57638166566b92d Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Wed, 12 Apr 2023 11:02:06 +0900 Subject: [PATCH] Update extension.ts --- extension/src/extension.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extension/src/extension.ts b/extension/src/extension.ts index b5ad749..e19ffdd 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -11,7 +11,7 @@ let client: LanguageClient | undefined; async function startLanguageClient(context: ExtensionContext) { try { const executablePath = (() => { - let executablePath = workspace + const executablePath = workspace .getConfiguration("pylyzer") .get("executablePath", ""); return executablePath === "" ? "pylyzer" : executablePath; @@ -23,7 +23,7 @@ async function startLanguageClient(context: ExtensionContext) { const smartCompletion = workspace.getConfiguration("pylyzer").get("smartCompletion", true); /* optional features */ const checkOnType = workspace.getConfiguration("pylyzer").get("checkOnType", false); - let args = ["--server"]; + const args = ["--server"]; if (!(enableDiagnostics && enableSemanticTokens && enableHover && smartCompletion) || (checkOnType || enableInlayHints)) { args.push("--"); } @@ -51,7 +51,7 @@ async function startLanguageClient(context: ExtensionContext) { args.push("--enable"); args.push("checkOnType"); } - let serverOptions: ServerOptions = { + const serverOptions: ServerOptions = { command: executablePath, args, }; @@ -69,6 +69,7 @@ async function startLanguageClient(context: ExtensionContext) { window.showErrorMessage( "Failed to start the pylyzer language server. Please make sure you have pylyzer installed.", ); + window.showErrorMessage(`Error: ${e}`); } } @@ -80,6 +81,7 @@ async function restartLanguageClient() { await client.restart(); } catch (e) { window.showErrorMessage("Failed to restart the pylyzer language server."); + window.showErrorMessage(`Error: ${e}`); } }