Question

Go To Definition functionality

Posted 29 days ago by Avatar Alexnaldo Santos

Hi,

I would like to implement Go To Definition functionality.

 

Is it possible?How?

 

Thanks.

Information The latest build of this product (2018.1 build 0340) was released 4 months ago, which was before this thread was created.

Comments (4)

Posted 29 days ago by Actipro Software Support - Cleveland, OH, USA

Hello,

Which syntax language are you using?  One of ours or a custom one of your own?


Actipro Software Support
Posted 27 days ago by Alexnaldo Santos

C# using SyntaxEditor .NET Languages Add-on.

Posted 26 days ago by Actipro Software Support - Cleveland, OH, USA

Hi Alexnaldo,

While we don't have anything built-in specifically for go to definition, it should be possible to implement it with the information we provide.  You could create a CSharpContextFactory and call its CreateContext method to get an IDotNetContext object back.  Then call that object's Resolve method to get a IResolverResultSet.  Look at the first result if there is one.  Each IResolverResult has an ITypeReference.  If there was a fully resolved result, this ITypeReference will be an ITypeDefinition.  ITypeDefinition has a SourceFileLocations collection that returns an ISourceFileLocation instance.  Each one of these consists of a string Key (which is generally a file path or document UniqueId GUID) and the NavigationOffset within that document.  By opening the related document and going to the NavigationOffset, you can achieve go to definition functionality.


Actipro Software Support
Posted 25 days ago by Alexnaldo Santos

Thanks. I will try it!


Add a Comment

Please log in to a validated account to post comments.