vscode: minor names and message contents changes

This commit is contained in:
Veetaha 2020-02-09 00:58:53 +02:00
parent fd6a98ef6e
commit d08ae7e82f
2 changed files with 12 additions and 9 deletions

View file

@ -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());

View file

@ -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;
}
}