Expanding hyperlink support

Armond
2013-04-07
2013-04-19
  • Armond

    Armond - 2013-04-07

    Hyperlink support is currently limited to class declarations because it was unclear at the time how to efficiently interrogate the DB in this context.

    The current implementation uses the SelectionConverter which looks up the selected word as declaration only.

    Any tips on how to proceed with adding support for say class methods, local variables and such? Scope is obviously something that must be consider as well.

     
  • Matthew Ballance

    A good approach here would be to lookup the containing scope (eg class) using the declaration cache, then locate the selected item within the scope. This approach should be quite efficient.

     
  • Matthew Ballance

    I've been thinking about this a bit more, and realized that much of the required functionality is implemented in the code for Open Declaration. net.sf.sveditor.core.open_decl.OpenDeclUtils.openDecl() calls utility methods to:

    • identify the containing scope (eg task, class, module)
    • Evaluate the expression that the cursor is positioned over
    • Traverse the expression to resolve types

    The result of the SVContentAssistExprVisitor is the resolved DB item. Calling the same utility methods that OpenDeclUtils calls should allow you to offer users an Open Declaration hyperlink for (as an example) a method invocation.

    Hope this helps!

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks