So, Dr. Racket has a very interesting feature where you can see all occurrences of a bound variable if you hover it:
Is there a way to do something similar in Emacs? I'm currently editing C++ code. It doesn't need to be super-sophisticated: I'd be super-happy with just the local lexical context.
This2 proved really useful to me, but it will highlight any matching words in the entire text, not just the code (let alone the enclosing lexical context.)