Hi,
I would like to implement Go To Definition functionality.
Is it possible?How?
Thanks.
Hi,
I would like to implement Go To Definition functionality.
Is it possible?How?
Thanks.
Hello,
Which syntax language are you using? One of ours or a custom one of your own?
C# using SyntaxEditor .NET Languages Add-on.
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.
Thanks. I will try it!
Please log in to a validated account to post comments.