Remove progress notification
This commit is contained in:
Родитель
514b3ce4b8
Коммит
c4b8e999ad
39
src/tasks.ts
39
src/tasks.ts
|
@ -355,8 +355,7 @@ function spawn(
|
|||
command: string,
|
||||
args?: ReadonlyArray<string>,
|
||||
options?: cp.ExecOptions,
|
||||
outputChannel?: OutputChannel,
|
||||
onProcessCreate?: (process: cp.ChildProcess) => void
|
||||
outputChannel?: OutputChannel
|
||||
): Promise<string> {
|
||||
if (outputChannel) {
|
||||
outputChannel.append(`Executing: ${command}\n`);
|
||||
|
@ -375,9 +374,6 @@ function spawn(
|
|||
);
|
||||
}
|
||||
});
|
||||
if (onProcessCreate) {
|
||||
onProcessCreate(child);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -400,38 +396,9 @@ function getTasksFromGradle(
|
|||
args.push(tasksArgs);
|
||||
}
|
||||
const { fsPath: cwd } = folder.uri;
|
||||
|
||||
let process: cp.ChildProcess;
|
||||
const promise = spawn(
|
||||
command,
|
||||
args,
|
||||
{ cwd },
|
||||
outputChannel,
|
||||
_p => (process = _p)
|
||||
return spawn(command, args, { cwd }, outputChannel).finally(() =>
|
||||
statusBarItem.hide()
|
||||
);
|
||||
const showProgress = setTimeout(() => {
|
||||
window.withProgress(
|
||||
{
|
||||
location: ProgressLocation.Notification,
|
||||
title: 'Loading Gradle Tasks',
|
||||
cancellable: true
|
||||
},
|
||||
(_, token) => {
|
||||
token.onCancellationRequested(() => {
|
||||
process.kill();
|
||||
window.showInformationMessage(
|
||||
'Operation cancelled. Try again using command "Gradle: Refresh Tasks"'
|
||||
);
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
);
|
||||
}, 5000);
|
||||
|
||||
return promise.finally(() => {
|
||||
clearTimeout(showProgress);
|
||||
statusBarItem.hide();
|
||||
});
|
||||
}
|
||||
|
||||
async function getTasks(
|
||||
|
|
Загрузка…
Ссылка в новой задаче