From 8e0d776369f807c1d3f60abb899d2fe0d83570d4 Mon Sep 17 00:00:00 2001 From: Vladimir Serov Date: Thu, 21 May 2020 18:49:30 +0300 Subject: editor/vscode: lint --- editors/code/src/main.ts | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'editors/code/src/main.ts') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 0a2c30594..1c6e3093b 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -192,13 +192,13 @@ async function bootstrapServer(config: Config, state: PersistentState): Promise< async function patchelf(dest: PathLike): Promise { await vscode.window.withProgress( { - location: vscode.ProgressLocation.Notification, + location: vscode.ProgressLocation.Notification, title: "Patching rust-analysis for NixOS" - }, + }, async (progress, _) => { - let patch_path = path.join(os.tmpdir(), "patch-ra.nix") - progress.report({message: "Writing nix file", increment: 5}) - await fs.writeFile(patch_path, ` + const patchPath = path.join(os.tmpdir(), "patch-ra.nix"); + progress.report({ message: "Writing nix file", increment: 5 }); + await fs.writeFile(patchPath, ` {src, pkgs ? import {}}: pkgs.stdenv.mkDerivation { name = "rust-analyzer"; @@ -210,23 +210,23 @@ async function patchelf(dest: PathLike): Promise { patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out ''; } - `) - let orig_file = dest + "-orig" - await fs.rename(dest, orig_file) - progress.report({message: "Patching executable", increment: 20}) + `); + const origFile = dest + "-orig"; + await fs.rename(dest, origFile); + progress.report({ message: "Patching executable", increment: 20 }); await new Promise((resolve, reject) => { - exec(`nix-build ${patch_path} --arg src '${orig_file}' -o ${dest}`, - (err, stdout, stderr) => { - if (err != null) { - reject(Error(stderr)) - } else { - resolve(stdout) - } - }) - }) - await fs.unlink(orig_file) + exec(`nix-build ${patchPath} --arg src '${origFile}' -o ${dest}`, + (err, stdout, stderr) => { + if (err != null) { + reject(Error(stderr)); + } else { + resolve(stdout); + } + }); + }); + await fs.unlink(origFile); } - ) + ); } async function getServer(config: Config, state: PersistentState): Promise { @@ -281,7 +281,7 @@ async function getServer(config: Config, state: PersistentState): Promise true).catch(_ => false)) { - await patchelf(dest) + await patchelf(dest); } await state.updateServerVersion(config.package.version); -- cgit v1.2.3