This documentation is archived and is not being maintained.

ViewFilter.HandleGoto Method

Processes the specified "go to" command.

This method is not CLS-compliant.  

Namespace: Microsoft.VisualStudio.Package
Assembly: Microsoft.VisualStudio.Package.LanguageService (in microsoft.visualstudio.package.languageservice.dll)

public virtual void HandleGoto (
	VSStd97CmdID cmd
)
public void HandleGoto (
	VSStd97CmdID cmd
)
public function HandleGoto (
	cmd : VSStd97CmdID
)

Parameters

cmd

[in] A value from the VSConstants.VSStd97CmdID enumeration specifying the type of "go to" command to execute. Expected values are GotoDefn, GotoDecl, and GotoRef.

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.

Show: