Udostępnij za pośrednictwem


ViewFilter.GetDataTipText(TextSpan[], String) Method

Definition

If Preferences.EnableQuickInfo is true then this method kicks of a parse with the reason ParseReason.QuickInfo to find information about the current token. If the parse finds something (returned via the AuthoringScope.GetDataTipText) then it is displayed using the TextTipData object. When the asynchronous parse is finished GetFullDataTipText is called to pop up the tip.

public:
 virtual int GetDataTipText(cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ aspan, [Runtime::InteropServices::Out] System::String ^ % textValue);
 virtual int GetDataTipText(std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & aspan, [Runtime::InteropServices::Out] std::wstring const & & textValue);
public virtual int GetDataTipText (Microsoft.VisualStudio.TextManager.Interop.TextSpan[] aspan, out string textValue);
abstract member GetDataTipText : Microsoft.VisualStudio.TextManager.Interop.TextSpan[] * string -> int
override this.GetDataTipText : Microsoft.VisualStudio.TextManager.Interop.TextSpan[] * string -> int
Public Overridable Function GetDataTipText (aspan As TextSpan(), ByRef textValue As String) As Integer

Parameters

aspan
TextSpan[]

[in, out] A TextSpan object specifying the location in the code to get information about and returns the span indicating the extent of the identifier or expression the text represents. This returned span indicates the area a mouse cursor can be in before the tool tip is dismissed.

textValue
String

[out] Returns a string to be displayed in a tool tip. This string is valid only if a success code is returned.

Returns

If successful, returns S_OK; otherwise, returns an error code. Since this method can begin a background parse operation, a typical error code that can be returned is E_PENDING if the background parse has not yet finished.

Implements

Remarks

This method is called to provide a tool tip for a selected span of code. If this method returns E_PENDING, this method is called again at a later time. This method should also take into account whether a debugger is running, in which case, the text returned typically represents the value of the selected span of code as reported by the debugger. For example, if the cursor is over a variable, the debugger evaluates the variable to obtain a value that is to be displayed.

This method is an implementation of the GetDataTipText method on the IVsTextViewFilter interface.

The base method does nothing if the EnableQuickInfo property returns false or there is a parse operation currently in progress. Otherwise, this method either starts a background parse with the reason QuickInfo or returns the result of a previous parse. If text can be returned, the base method returns the success code TIP_S_ONLYIFNOMARKER, to indicate the text can be displayed but text from any error markers at the same location take precedence.

Applies to