Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/bootstrap.ts')
| -rw-r--r-- | editors/code/src/bootstrap.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/editors/code/src/bootstrap.ts b/editors/code/src/bootstrap.ts index b38fa06a85..ef4dff095c 100644 --- a/editors/code/src/bootstrap.ts +++ b/editors/code/src/bootstrap.ts @@ -1,20 +1,20 @@ import * as vscode from "vscode"; import * as os from "os"; -import { Config } from "./config"; +import type { Config } from "./config"; import { log, isValidExecutable } from "./util"; -import { PersistentState } from "./persistent_state"; +import type { PersistentState } from "./persistent_state"; import { exec } from "child_process"; export async function bootstrap( context: vscode.ExtensionContext, config: Config, - state: PersistentState + state: PersistentState, ): Promise<string> { const path = await getServer(context, config, state); if (!path) { throw new Error( "Rust Analyzer Language Server is not available. " + - "Please, ensure its [proper installation](https://rust-analyzer.github.io/manual.html#installation)." + "Please, ensure its [proper installation](https://rust-analyzer.github.io/manual.html#installation).", ); } @@ -34,9 +34,9 @@ export async function bootstrap( async function getServer( context: vscode.ExtensionContext, config: Config, - state: PersistentState + state: PersistentState, ): Promise<string | undefined> { - const explicitPath = process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath; + const explicitPath = process.env["__RA_LSP_SERVER_DEBUG"] ?? config.serverPath; if (explicitPath) { if (explicitPath.startsWith("~/")) { return os.homedir() + explicitPath.slice("~".length); @@ -49,7 +49,7 @@ async function getServer( const bundled = vscode.Uri.joinPath(context.extensionUri, "server", `rust-analyzer${ext}`); const bundledExists = await vscode.workspace.fs.stat(bundled).then( () => true, - () => false + () => false, ); if (bundledExists) { let server = bundled; @@ -58,7 +58,7 @@ async function getServer( const dest = vscode.Uri.joinPath(config.globalStorageUri, `rust-analyzer${ext}`); let exists = await vscode.workspace.fs.stat(dest).then( () => true, - () => false + () => false, ); if (exists && config.package.version !== state.serverVersion) { await vscode.workspace.fs.delete(dest); @@ -81,7 +81,7 @@ async function getServer( "run `cargo xtask install --server` to build the language server from sources. " + "If you feel that your platform should be supported, please create an issue " + "about that [here](https://github.com/rust-lang/rust-analyzer/issues) and we " + - "will consider it." + "will consider it.", ); return undefined; } @@ -131,7 +131,7 @@ async function patchelf(dest: vscode.Uri): Promise<void> { } else { resolve(stdout); } - } + }, ); handle.stdin?.write(expression); handle.stdin?.end(); @@ -139,6 +139,6 @@ async function patchelf(dest: vscode.Uri): Promise<void> { } finally { await vscode.workspace.fs.delete(origFile); } - } + }, ); } |