-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Highlight exit and yield points #9375
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
Moves in the right direction! Couple of relevant thoughts:
|
I don't think it needs to be a separate request See microsoft/language-server-protocol#1047 |
Ye I think we don't need a separate request for that, but then the question is how we highlight exit points in regards to the trailing expression as that can overlap with the general ident highlight. |
If the cursor is on ? / return or return type ( if the cursor is on async / await, we should highlight all yield points. if the cursor is within trailing expression, we should highlight references or nothing. The name for all three I think is “highlight_related”? |
Yield point and exit point highlighting is implemented as well now.
|
Okay things are working but VSCode doesn't send a highlight request when the cursor goes onto non identifier symbols from what I can tell, that means clicking on |
Currently when the trailing expression is an |
Yeah, it’s better to highlight expressions in the tail position. I think we should have functionality for that implemented somewhere already, but I don’t remember where. Ok-wrapping maybe? |
Got it! We have “change return type to Result” assist! |
Oh ye looks like that assist does similar things to what is wanted here, I'll take a look at that tomorrow |
8 => 'a: loop { | ||
'b: loop { | ||
break 'a 5; | ||
// ^^^^^^^^^^ | ||
break 'b 5; | ||
break 5; | ||
}; |
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.
I wonder if I overdid this a bit by also considering (labeled) breaks in loops 😄
Managed to simplify things a bit more, but I couldn't really reuse the |
Fixes #4691