mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Add special auto
value for debug.sourceFileMap
This commit is contained in:
parent
8f781e782c
commit
1ebfe11730
5 changed files with 38 additions and 27 deletions
|
@ -1,7 +1,7 @@
|
|||
import * as lc from "vscode-languageclient/node";
|
||||
import * as vscode from "vscode";
|
||||
import { strict as nativeAssert } from "assert";
|
||||
import { spawnSync } from "child_process";
|
||||
import { exec, ExecOptions, spawnSync } from "child_process";
|
||||
import { inspect } from "util";
|
||||
|
||||
export function assert(condition: boolean, explanation: string): asserts condition {
|
||||
|
@ -141,3 +141,22 @@ export function memoize<Ret, TThis, Param extends string>(func: (this: TThis, ar
|
|||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/** Awaitable wrapper around `child_process.exec` */
|
||||
export function execute(command: string, options: ExecOptions): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(command, options, (err, stdout, stderr) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (stderr) {
|
||||
reject(new Error(stderr));
|
||||
return;
|
||||
}
|
||||
|
||||
resolve(stdout.trimEnd());
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue