AuthoringScope::Goto Method (VSConstants::VSStd97CmdID, IVsTextView^, Int32, Int32, TextSpan)
Returns a URI (Universal Resource Identifier) based on the current location in the source and the specified command.
Assembly: Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)
public: virtual String^ Goto( VSConstants::VSStd97CmdID cmd, IVsTextView^ textView, int line, int col, [OutAttribute] TextSpan% span ) abstract
Parameters
- cmd
-
Type:
Microsoft.VisualStudio::VSConstants::VSStd97CmdID
[in] A value from the VSConstants::VSStd97CmdID enumeration that determines what kind of destination URI must be returned. This is the command the user entered, typically from a context menu.
- textView
-
Type:
Microsoft.VisualStudio.TextManager.Interop::IVsTextView^
[in] The IVsTextView object containing the text under the cursor.
- line
-
Type:
System::Int32
[in] The line number containing the text under the cursor.
- col
-
Type:
System::Int32
[in] The offset into the line containing the text under the cursor.
- span
-
Type:
Microsoft.VisualStudio.TextManager.Interop::TextSpan
[out] A TextSpan object marking the selected text area for which the URI is determined.
Return Value
Type: System::String^If successful, returns a string containing the URI; otherwise, returns a null value.
This method is called to return the location of a file that contains the definition, declaration, or reference of the text at the specified position. For example, if the user places the caret on a class name and selected Go to Declaration from the context menu, the URI that is returned contains the path to the file containing the declaration of that class and the returned TextSpan indicates the entire class name at the caret position.
In the default managed package framework implementation, this method is called from the Source class method M:Microsoft.VisualStudio.Package.Source.OnSyncGoto(Microsoft.VisualStudio.VSConstants.VSStd97CmdID,Microsoft.VisualStudio.TextManager.Interop.IVsTextView,System.Int32,System.Int32,Microsoft.VisualStudio.TextManager.Interop.TextSpan@) that in turn is called from the ViewFilter method HandleGoto that in turn is called in response to a user command to go to a declaration, definition, or reference. The Source class method M:Microsoft.VisualStudio.Package.Source.OnSyncGoto(Microsoft.VisualStudio.VSConstants.VSStd97CmdID,Microsoft.VisualStudio.TextManager.Interop.IVsTextView,System.Int32,System.Int32,Microsoft.VisualStudio.TextManager.Interop.TextSpan@) executes a parse operation with the reason Goto. If the parse operation returns an AuthoringScope object then this method is called to obtain the URI.