AuthoringScope.GetDataTipText Method
Returns a string to be used for a tool tip based on the specified location.
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.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'Declaration
Public MustOverride Function GetDataTipText ( _
line As Integer, _
col As Integer, _
<OutAttribute> ByRef span As TextSpan _
) As String
public abstract string GetDataTipText(
int line,
int col,
out TextSpan span
)
public:
virtual String^ GetDataTipText(
int line,
int col,
[OutAttribute] TextSpan% span
) abstract
abstract GetDataTipText :
line:int *
col:int *
span:TextSpan byref -> string
public abstract function GetDataTipText(
line : int,
col : int,
span : TextSpan
) : String
Parameters
line
Type: Int32[in] The line in the source to look at for a tool tip.
col
Type: Int32[in] An offset within the line to look at for a tool tip.
span
Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan%A TextSpan that describes the area over which the cursor can hover before the tool tip is dismissed from view.
Return Value
Type: String
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, OnSyncQuickInfo, 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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.