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

Support Question Mark Operator in Control Flow Highlighting #18147

Closed
CryZe opened this issue Sep 19, 2024 · 5 comments · Fixed by #18152
Closed

Support Question Mark Operator in Control Flow Highlighting #18147

CryZe opened this issue Sep 19, 2024 · 5 comments · Fixed by #18152
Labels
C-feature Category: feature request

Comments

@CryZe
Copy link
Contributor

CryZe commented Sep 19, 2024

rust-analyzer can nicely highlight which control flow relevant pieces of the code relate to each other, such as shown here:

Image

This currently does not extend to the question mark operator:

Image

However, while writing this issue, I did notice that it actually works perfectly fine already if you are on the fn itself:

Image

@CryZe CryZe added the C-feature Category: feature request label Sep 19, 2024
@ChayimFriedman2
Copy link
Contributor

ChayimFriedman2 commented Sep 19, 2024

That is really really weird... We have code for highlighting when on -> or ?, we have tests for them, the tests pass, yet this does not work! Could it be that VSCode is not sending highlight requests for symbols?

@CryZe
Copy link
Contributor Author

CryZe commented Sep 19, 2024

That sounds plausible at least.

@Veykril
Copy link
Member

Veykril commented Sep 19, 2024

This is a known VSCode issue

@Veykril
Copy link
Member

Veykril commented Sep 19, 2024

Duplicate of #9395

@Veykril Veykril marked this as a duplicate of #9395 Sep 19, 2024
@Veykril Veykril closed this as completed Sep 19, 2024
@CryZe
Copy link
Contributor Author

CryZe commented Sep 19, 2024

A case that definitely does not work atm is the following:
Image

The cursor is on the async but only the return is marked, not the implicit return or the question mark operator.

bors added a commit that referenced this issue Oct 14, 2024
…kril

feat: Highlight exit points of async blocks

Async blocks act similar to async functions in that the await keywords are related, but also act like functions where the exit points are related.

Fixes #18147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants