Skip to content

Remove old workaround in vscode extension #10053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions editors/code/src/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,4 @@ async function downloadFile(
const srcStream = gunzip ? res.body.pipe(zlib.createGunzip()) : res.body;

await pipeline(srcStream, destFileStream);

// Don't apply the workaround in fixed versions of nodejs, since the process
// freezes on them, the process waits for no-longer emitted `close` event.
// The fix was applied in commit 7eed9d6bcc in v13.11.0
// See the nodejs changelog:
// https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V13.md
const [, major, minor] = /v(\d+)\.(\d+)\.(\d+)/.exec(process.version)!;
if (+major > 13 || (+major === 13 && +minor >= 11)) return;

await new Promise<void>(resolve => {
destFileStream.on("close", resolve);
destFileStream.destroy();
// This workaround is awaiting to be removed when vscode moves to newer nodejs version:
// https://github.com/rust-analyzer/rust-analyzer/issues/3167
});
}