From d08ae7e82f9eb4abb92f1274ea361acb21fd7b87 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 9 Feb 2020 00:58:53 +0200 Subject: vscode: minor names and message contents changes --- editors/code/src/ctx.ts | 5 ++++- editors/code/src/installation/language_server.ts | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'editors') diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index f0e2d72f7..70042a479 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -31,7 +31,10 @@ export class Ctx { this.client = null; const client = await createClient(this.config); if (!client) { - throw new Error("Rust Analyzer Language Server is not available"); + throw new Error( + "Rust Analyzer Language Server is not available. " + + "Please, ensure its [proper installation](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#vs-code)." + ); } this.pushCleanup(client.start()); diff --git a/editors/code/src/installation/language_server.ts b/editors/code/src/installation/language_server.ts index 522d59eb5..d09fc63a7 100644 --- a/editors/code/src/installation/language_server.ts +++ b/editors/code/src/installation/language_server.ts @@ -72,19 +72,19 @@ export async function ensureLanguageServerBinary( return langServerSource.path; } vscode.window.showErrorMessage( - `Unable to execute ${'`'}${langServerSource.path} --version${'`'}. ` + - "To use the bundled language server, set `rust-analyzer.raLspServerPath` " + + `Unable to run ${langServerSource.path} binary. ` + + "To use the pre-built language server, set `rust-analyzer.raLspServerPath` " + "value to `null` or remove it from the settings to use it by default." ); return null; } case BinarySource.Type.GithubRelease: { - const bundledBinaryPath = path.join(langServerSource.dir, langServerSource.file); + const prebuiltBinaryPath = path.join(langServerSource.dir, langServerSource.file); - if (!isBinaryAvailable(bundledBinaryPath)) { + if (!isBinaryAvailable(prebuiltBinaryPath)) { const userResponse = await vscode.window.showInformationMessage( - `Language server binary for rust-analyzer was not found. ` + - `Do you want to download it now?`, + "Language server binary for rust-analyzer was not found. " + + "Do you want to download it now?", "Download now", "Cancel" ); if (userResponse !== "Download now") return null; @@ -101,7 +101,7 @@ export async function ensureLanguageServerBinary( assert( - isBinaryAvailable(bundledBinaryPath), + isBinaryAvailable(prebuiltBinaryPath), "Downloaded language server binary is not functional" ); @@ -109,7 +109,7 @@ export async function ensureLanguageServerBinary( "Rust analyzer language server was successfully installed 🦀" ); } - return bundledBinaryPath; + return prebuiltBinaryPath; } } -- cgit v1.2.3