Skip to content

Commit 06604c5

Browse files
committed
fix
1 parent 7ee4deb commit 06604c5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/cm/lsp/serverLauncher.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ const STATUS_DECLINED: InstallStatus = "declined";
2525
const STATUS_FAILED: InstallStatus = "failed";
2626

2727
const AXS_BINARY = "$PREFIX/axs";
28-
const TERMINAL_REQUIRED_MESSAGE = strings.terminal_required_message_for_lsp;
28+
29+
function getTerminalRequiredMessage(): string {
30+
return (
31+
strings?.terminal_required_message_for_lsp ??
32+
"Terminal not installed. Please install Terminal first to use LSP servers."
33+
);
34+
}
2935

3036
interface LspError extends Error {
3137
code?: string;
@@ -610,8 +616,9 @@ export async function ensureServerRunning(
610616
isTerminalInstalled = Boolean(await terminal?.isInstalled?.());
611617
} catch {}
612618
if (!isTerminalInstalled) {
613-
alert(strings.error, TERMINAL_REQUIRED_MESSAGE);
614-
const unavailable: LspError = new Error(TERMINAL_REQUIRED_MESSAGE);
619+
const message = getTerminalRequiredMessage();
620+
alert(strings?.error, message);
621+
const unavailable: LspError = new Error(message);
615622
unavailable.code = "LSP_SERVER_UNAVAILABLE";
616623
throw unavailable;
617624
}

0 commit comments

Comments
 (0)