editor/code: Re-apply code format

This commit is contained in:
Tetsuharu Ohzeki 2023-07-11 22:35:10 +09:00
parent 9d06aa55b4
commit f7823f3106
17 changed files with 180 additions and 175 deletions

View file

@ -8,13 +8,13 @@ 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,7 +34,7 @@ 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;
if (explicitPath) {
@ -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);
}
}
},
);
}