Skip to content

Commit 9203a40

Browse files
committed
change install to show in notification
1 parent 90deb28 commit 9203a40

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

vscode/src/find_server.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,18 @@ async function installServer(command: string) {
6262
const action = findExecutable(command) ? "Updating" : "Installing";
6363

6464
return window.withProgress({
65-
location: ProgressLocation.Window,
65+
location: ProgressLocation.Notification,
6666
title: `${action} ${command}`,
67-
cancellable: false
68-
}, async (progress) => {
67+
cancellable: true
68+
}, async (progress, token) => {
6969
return new Promise<void>((resolve, reject) => {
7070
const installProcess = cp.spawn(cargoPath!, ["install", "--color", "never", command]);
7171

72+
token.onCancellationRequested(() => {
73+
installProcess.kill("SIGTERM");
74+
reject(new Error("Installation canceled"));
75+
});
76+
7277
const reportProgress = (data: Buffer) => {
7378
const lines = data.toString()
7479
.split(/\r?\n/)

0 commit comments

Comments
 (0)