Posted 14 years ago by Iurii Gazin
Version: 4.0.0283
Avatar
Hello. I`m trying to implement Go To Declaration menu into my code. I can take current Token, but I don`t know in what direction I can move next.
How can I, using token, get type, that this token is forwarding to?

Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The tokens aren't that smart, as they are simply ranges of text constructed by text patterns. It is the AST model (in the Document.SemanticParseData) that you'd want to examine. You'd need to recurse down to the caret's offset and determine if there is a variable reference there. If so then you'd have to navigate the AST to look for a type/member/variable declaration in a reachable scope of that same name. Then jump to its declaration offset. There is not an easier way to do it at this time. It's something we'll consider improving support for in the future though.


Actipro Software Support

The latest build of this product (v24.1.0) 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.