Share via


AuthoringScope.Goto Method

Returns a URI (Universal Resource Identifier) based on the current location in the source and the specified command.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public MustOverride Function Goto ( _
    cmd As VSConstants..::..VSStd97CmdID, _
    textView As IVsTextView, _
    line As Integer, _
    col As Integer, _
    <OutAttribute> ByRef span As TextSpan _
) As String
public abstract string Goto(
    VSConstants..::..VSStd97CmdID cmd,
    IVsTextView textView,
    int line,
    int col,
    out TextSpan span
)
public:
virtual String^ Goto(
    VSConstants..::..VSStd97CmdID cmd, 
    IVsTextView^ textView, 
    int line, 
    int col, 
    [OutAttribute] TextSpan% span
) abstract
abstract Goto : 
        cmd:VSConstants..::..VSStd97CmdID * 
        textView:IVsTextView * 
        line:int * 
        col:int * 
        span:TextSpan byref -> string 
public abstract function Goto(
    cmd : VSConstants..::..VSStd97CmdID, 
    textView : IVsTextView, 
    line : int, 
    col : int, 
    span : TextSpan
) : String

Parameters

  • 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.

Return Value

Type: System.String
If successful, returns a string containing the URI; otherwise, returns a null value.

Remarks

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 OnSyncGoto(VSConstants.VSStd97CmdID, IVsTextView, Int32, Int32, 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 OnSyncGoto(VSConstants.VSStd97CmdID, IVsTextView, Int32, Int32, 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.

.NET Framework Security

See Also

Reference

AuthoringScope Class

Microsoft.VisualStudio.Package Namespace