rust-analyzer has a really cute feature "highlight related". It will highlight the enclosing loop when cursor is on `break`, or the enclosing `async` when cursor is on `await`:
miniblog.
Related Posts
I've been thinking about making difftastic smarter about context. In principle it understands structure, so I could limit context to the enclosing definition.
However, sometimes it's nice to see surrounding code. Line 644 isn't useful, but maybe 655 is. Opinions?
Readable tree diffing is a really interesting problem. When do you highlight lists? Do you highlight all the lists enclosing a modified subtree? What about comments?
I'm relatively happy with this case, but I think the outermost lists shouldn't be highlighted at all.
Smalltalk has a concept of blocks, which is a lightweight syntax for anonymous functions.
However, they have this marvellous property: you can return from the enclosing method! This makes them far more useful for things like iterating with early termination.

