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

for await...of statement prevents function from being folded properly #85

Closed
aviflax opened this Issue Nov 1, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@aviflax

aviflax commented Nov 1, 2018

My code unfolded:

async function readEntireTextStream(stream) {
  let str = '';
  stream.setEncoding('utf8');
  for await (const chunk of stream) {
    str += chunk;
  }
  return str;
}

What it looks like when I try to fold the function:

screen shot 2018-11-01 at 16 14 35

I’ve included the following function just to illustrate how I expect readEntireTextStream to fold: exactly like puppeteerOpts.

I know for await...of is only a draft but it’s been (experimentally) supported in Node since 10.0.0, released 2018-04-24.

I’m using:

  • Atom 1.32.1
  • language-javascript 0.129.15
  • MacOS 10.13.6 (17G65)
@maxbrunsfeld

This comment has been minimized.

Member

maxbrunsfeld commented Nov 1, 2018

Thanks for the minimal code example! I'll publish a fix shortly.

@aviflax

This comment has been minimized.

aviflax commented Nov 1, 2018

My pleasure! Thanks for the rapid response!

@maxbrunsfeld

This comment has been minimized.

Member

maxbrunsfeld commented Nov 1, 2018

This will be included in Atom 1.32.2, which should go out in the next few days.

maxbrunsfeld added a commit to tree-sitter/tree-sitter-typescript that referenced this issue Nov 1, 2018

maxbrunsfeld added a commit to atom/language-javascript that referenced this issue Nov 1, 2018

maxbrunsfeld added a commit to atom/language-typescript that referenced this issue Nov 1, 2018

@aviflax

This comment has been minimized.

aviflax commented Nov 1, 2018

Fixed in less than 10 minutes! 🚀💪👏 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment