-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Apply async semantic token modifier to async/await keywords #8831
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
Conversation
Only async semantic token modifier
| }) | ||
| .map(|modifier| h | modifier) | ||
| .unwrap_or(h), | ||
| T![async] | T![await] => h | HlMod::Async, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T![await] is being matched in an earlier arm already as its being tagged with ControlFlow as well, you'll have to special case that one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified, now only match the async.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry I meant removing T![await] from the other arms and adding T![await] => h | HlMod::Async | HlMod::ControlFlow, as its both control flow and async.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I misunderstood you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem
|
Could you add some test data to https://github.com/rust-analyzer/rust-analyzer/blob/9803a9a148e1c5850d2f649ffbc1bb3575cfa929/crates/ide/src/syntax_highlighting/tests.rs#L9-L216? Just an async function definition and a call of the function + awaiting its result should suffice. Doesn't need to to type check. |
Added. |
|
Thanks! |
close #8633