Skip to content

Commit

Permalink
fix: download race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarrus1 committed Jul 18, 2023
1 parent 3917a14 commit 13aa2bc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Fixed a bug where the server could not be force restarted.
- Fixed a UI glitch in the doctor command.
- Fixed a race condition when creating a new release for the Sourcepawn Language Server.

## [5.4.0]

Expand Down
30 changes: 18 additions & 12 deletions src/Commands/installLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,24 @@ export async function run(args: any) {
);
return 1;
}

await window.withProgress(
{
location: ProgressLocation.Notification,
title: "SourcePawn LanguageServer",
cancellable: true,
},
async (progress, token) => {
return downloadLanguageServer(version, progress, token);
}
);
ctx?.start();
try {
await window.withProgress(
{
location: ProgressLocation.Notification,
title: "SourcePawn LanguageServer",
cancellable: true,
},
async (progress, token) => {
return downloadLanguageServer(version, progress, token);
}
);
ctx?.start();
} catch (err) {
console.error(
`Could not download version ${version} of the Sourcepawn Language Server. Try again in a few minutes.`
);
return 2;
}

return 0;
}
Expand Down

0 comments on commit 13aa2bc

Please sign in to comment.