Skip to content

Conversation

@0xPoe
Copy link
Member

@0xPoe 0xPoe commented May 14, 2021

close #8633

@0xPoe 0xPoe force-pushed the rustin-fix-async branch from 53b2bbd to b98c119 Compare May 14, 2021 02:47
})
.map(|modifier| h | modifier)
.unwrap_or(h),
T![async] | T![await] => h | HlMod::Async,
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I misunderstood you.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your help!

Copy link
Member

Choose a reason for hiding this comment

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

No problem

@Veykril
Copy link
Member

Veykril commented May 14, 2021

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.

@0xPoe
Copy link
Member Author

0xPoe commented May 14, 2021

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.

@0xPoe 0xPoe force-pushed the rustin-fix-async branch from ddeed63 to 765ccf2 Compare May 14, 2021 09:47
@Veykril
Copy link
Member

Veykril commented May 14, 2021

Thanks!
bors r+

@bors
Copy link
Contributor

bors bot commented May 14, 2021

@bors bors bot merged commit ab528e8 into rust-lang:master May 14, 2021
@0xPoe 0xPoe deleted the rustin-fix-async branch May 14, 2021 10:03
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.

Apply async semantic token modifier to async/await keywords

2 participants