Posted 1 year ago by Mike Deck - Autodesk, Inc.
Version: 22.1.4

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 1 year ago]

Comments (1)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA

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 (v24.1.2) 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.