Skip to content

Avoid spurious "illegal await" error in IDE with nesting #143

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
Oct 9, 2015

Conversation

retronym
Copy link
Member

@retronym retronym commented Oct 9, 2015

The presentation compiler runs with -Ymacro-expand:discard, which
retains the macro expandee in the typechecked trees, rather than
substituting in the expansion. This mode was motivated as a means
to keep IDE functionality working (e.g. completion, navigation,
refactoring) inside macro applications.

However, if one has nested async macro applications, as reported in
the IDE ticket:

https://www.assembla.com/spaces/scala-ide/tickets/1002561

... the expansion of the outer async application was reporting
await calls enclosed by the inner async application.

This change tweaks the traversers used for this analysis to
stop whenever it sees an async.

The presentation compiler runs with `-Ymacro-expand:discard`, which
retains the macro expandee in the typechecked trees, rather than
substituting in the expansion. This mode was motivated as a means
to keep IDE functionality working (e.g. completion, navigation,
refactoring) inside macro applications.

However, if one has nested async macro applications, as reported in
the IDE ticket:

  https://www.assembla.com/spaces/scala-ide/tickets/1002561

... the expansion of the outer async application was reporting
await calls enclosed by the inner async application.

This change tweaks the traversers used for this analysis to
stop whenever it sees an async.
@retronym
Copy link
Member Author

retronym commented Oct 9, 2015

@sschaef This should fix https://www.assembla.com/spaces/scala-ide/tickets/1002561#/activity/ticket . (I still can't figure out how to comment on Assembla tickets, the "leave a comment" link doesn't work for me when logged in as jzaugg at gmail.com

retronym added a commit that referenced this pull request Oct 9, 2015
Avoid spurious "illegal await" error in IDE with nesting
@retronym retronym merged commit 656748c into scala:master Oct 9, 2015
@kiritsuku
Copy link

Thanks for the fix. I'm going to try it out. I gave your account on Assembla edit permissions, you already had an account btw: https://www.assembla.com/profile/jason.zaugg

@kiritsuku
Copy link

I can confirm, the problem is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants