Posted 11 months ago by Mike Deck - Autodesk, Inc.
Version: 22.1.4
Avatar

Is there a way to highlight all references to an identifier (in the scope where it is declared)?
If it can't be done through the API, I do have a source code license.

I'm looking for something similar to the "Highlight references to symbol under cursor" option in Visual Studio 2022 (under Options > Text Editor > Visual Basic > Advanced. This is on by default.

A similar automatic highlighting option is right next to it: "Highlight related keywords under cursor". This will, for instance, highlight the End If corresponding to an If statement.

[Modified 11 months ago]

Comments (1)

Posted 11 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mike,

Unfortunately we don't have any functionality to that extent built in.  Finding references would probably require more of a compiler sort of functionality, which is beyond the scope of the add-on.  That being said, you certainly could try and use Roslyn to try and find references to a symbol.

We don't have a highlight related keywords option either.  For that you could do some token (although beware of doing that synchronously in very large documents to avoid freezing UI) or AST scanning.  Remember the parse data for a document that possibly has AST info in it comes back asynchronously after edits, and any offsets in the AST would need to be translated from the parse data's snapshot over to the document's current snapshot.


Actipro Software Support

The latest build of this product (v23.1.4) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.