mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
⬆️ rust-analyzer
This commit is contained in:
parent
544b4cfe4d
commit
dbf04a5ee2
106 changed files with 2219 additions and 609 deletions
|
@ -150,9 +150,11 @@ export function memoizeAsync<Ret, TThis, Param extends string>(
|
|||
|
||||
/** Awaitable wrapper around `child_process.exec` */
|
||||
export function execute(command: string, options: ExecOptions): Promise<string> {
|
||||
log.info(`running command: ${command}`);
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(command, options, (err, stdout, stderr) => {
|
||||
if (err) {
|
||||
log.error(err);
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
|
@ -167,6 +169,21 @@ export function execute(command: string, options: ExecOptions): Promise<string>
|
|||
});
|
||||
}
|
||||
|
||||
export function executeDiscoverProject(command: string, options: ExecOptions): Promise<string> {
|
||||
log.info(`running command: ${command}`);
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(command, options, (err, stdout, _) => {
|
||||
if (err) {
|
||||
log.error(err);
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
|
||||
resolve(stdout.trimEnd());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export class LazyOutputChannel implements vscode.OutputChannel {
|
||||
constructor(name: string) {
|
||||
this.name = name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue