Skip to content
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

switch to use iconv-lite-umd for #79275 #100472

Merged
merged 2 commits into from
Jun 18, 2020
Merged

switch to use iconv-lite-umd for #79275 #100472

merged 2 commits into from
Jun 18, 2020

Conversation

gyzerok
Copy link
Contributor

@gyzerok gyzerok commented Jun 18, 2020

This is next PR in a series for #79275

Update: Didn't get any test failure locally. Will fix it.

@bpasero bpasero self-assigned this Jun 18, 2020
@bpasero bpasero modified the milestones: Backlog Candidates, June 2020 Jun 18, 2020
Comment on lines +56 to +65
const decoder = iconv.getDecoder(encoding);
process.stdin.on('error', stdinFileStream.destroy);
process.stdin.on('data', (chunk) => {
stdinFileStream.write(decoder.write(chunk));
});
process.stdin.on('end', () => {
stdinFileStream.write(decoder.end());
stdinFileStream.end();
});
process.stdin.on('close', stdinFileStream.close);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bpasero I am not sure how correct is what I am trying to achieve here. Also I am not entirely sure what would be the best way to test that everything is working as expected.

Alternatively we can change iconv-lite-umd to expose streaming interface and keep code here as it was.

Can you help me here to figure out which route to take?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gyzerok a way to test this is to run ps aux | grep code | ./scripts/code-cli.sh - which will pipe something into VSCode. The idea here is that if the terminal is using a non-utf8 encoding, we need to convert it.

I think your code is doing OK, I looked into that earlier. Any objections to that path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bpasero yeah, seems to work fine then. I prefer this way better because if we don't expose streaming API from iconv-lite-umd there is not chance that someone will accidentally use it in the wrong environment.

Can you restart the failed job? It looks like it was just some random failure. Otherwise it's ready then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually nvm with the job. I'll squash commits for cleaner history.

@bpasero bpasero merged commit 314b58c into microsoft:master Jun 18, 2020
@bpasero
Copy link
Member

bpasero commented Jun 18, 2020

Thanks! Nevermind the commits, I always "Squash and merge" PRs typically.

@gyzerok gyzerok deleted the use-iconv-lite-umd branch June 18, 2020 23:04
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants