0

We are developing an Visual Studio Addin which should allow users to jump to code positons within a new created function (of course using CodeAnalysis). Actually we can only jump to the Symbols using VisualStudioWorkspace.TryGoToDefinition. The underlying interface IDocumentNavigationService would be very helpful since it provides methods like TryNavigateToSpan or TryNavigateToPosition, but the interface is internal and so we can't get the an instance of the Navigation Service.

Is there some other service that would help us? Or does anybody know if there are plans to make the IDocumentNavigationService interface public?

Tamas
  • 6,260
  • 19
  • 30
Chris
  • 93
  • 1
  • 5

1 Answers1

1

If you want us to make it public, just file a bug on GitHub. In the mean time, adapting from this answer is probably the right thing to do, although in your case you can get the DTE2 interface by doing (DTE2)GetService(typeof(SDTE)) from your package. There's other approaches mentioned here as well.

Community
  • 1
  • 1
Jason Malinowski
  • 18,148
  • 1
  • 38
  • 55