Partager via


AuthoringScope.GetDataTipText(Int32, Int32, TextSpan) Method

Definition

Returns a string to be used for a tool tip based on the specified location.

public:
 abstract System::String ^ GetDataTipText(int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan % span);
public:
 abstract Platform::String ^ GetDataTipText(int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan &  span);
 abstract std::wstring GetDataTipText(int line, int col, [Runtime::InteropServices::Out] Microsoft::VisualStudio::TextManager::Interop::TextSpan & span);
public abstract string GetDataTipText (int line, int col, out Microsoft.VisualStudio.TextManager.Interop.TextSpan span);
abstract member GetDataTipText : int * int * TextSpan -> string
Public MustOverride Function GetDataTipText (line As Integer, col As Integer, ByRef span As TextSpan) As String

Parameters

line
Int32

[in] The line in the source to look at for a tool tip.

col
Int32

[in] An offset within the line to look at for a tool tip.

span
TextSpan

A TextSpan that describes the area over which the cursor can hover before the tool tip is dismissed from view.

Returns

If successful, returns a string containing the text for the tool tip; otherwise, returns a null value.

Remarks

This method must be implemented in a class derived from the AuthoringScope class.

This method returns a string to be used as a tool tip when the user selects Quick Info with the caret positioned on or holds the cursor over an interesting bit of code. This method is typically called after a parse has been executed with the reason QuickInfo. Once the parse has been completed, any text returned by this method is displayed in a tool tip.

In the default managed package framework (MPF) implementation, the GetDataTipText method in the ViewFilter class is called when the user holds the cursor over one spot long enough to trigger a tool tip event. If EnableQuickInfo returns true, GetDataTipText begins a background parse if no data is yet available. Otherwise, the GetDataTipText method calls the ViewFilter class method, GetFullDataTipText which checks for an active debugging session and if debugging is active, whatever text the debugger returns for a tool tip is appended to the text returned from the GetDataTipText method.

This method is also called when the user selects Quick Info. In this case, the default MPF implementation calls the ViewFilter class method HandleQuickInfo that in turn calls the Source class method, <xref:Microsoft.VisualStudio.Package.Source.OnSyncQuickInfo%2A>, that in turn executes the parse request with the reason QuickInfo. The GetDataTipText method is then called to get the data text that is then added to any text returned from an active debugging session and finally displayed.

Applies to