Compartilhar via


ViewFilter.HandleGoto Method

Processes the specified "go to" command.

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

Syntax

'Declaration
Public Overridable Sub HandleGoto ( _
    cmd As VSConstants.VSStd97CmdID _
)
public virtual void HandleGoto(
    VSConstants.VSStd97CmdID cmd
)
public:
virtual void HandleGoto(
    VSConstants::VSStd97CmdID cmd
)
abstract HandleGoto : 
        cmd:VSConstants.VSStd97CmdID -> unit  
override HandleGoto : 
        cmd:VSConstants.VSStd97CmdID -> unit
public function HandleGoto(
    cmd : VSConstants.VSStd97CmdID
)

Parameters

Remarks

This method is called to handle a "go to" command. This method is responsible for obtaining the appropriate uniform resource identifier (URI) from the parser and then loading the requested document.

The base method calls the GetCaretPos method on the IVsTextView object passed to the ViewFilter constructor to obtain the current caret position. This position is then passed to the OnSyncGoto method on the Source object (obtained from the CodeWindowManager object in the ViewFilter constructor). If OnSyncGoto returned a valid URI then the URI is passed to the OpenDocument helper method in the VsShell class to open the document. If the document is successfully opened, the EnsureSpanVisible method is called followed by the SetSelection method to show the destination span in the loaded file.

In the default managed package framework implementation of the language service classes, this method is called from the HandlePreExec method.

.NET Framework Security

See Also

Reference

ViewFilter Class

Microsoft.VisualStudio.Package Namespace