IVsLanguageTextOps::GetDataTip Method (IVsTextLayer^, array<TextSpan>^, array<TextSpan>^, String^)

 

Displays a tip over a span of text when the mouse hovers over this location.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

int GetDataTip(
	IVsTextLayer^ pTextLayer,
	array<TextSpan>^ ptsSel,
	array<TextSpan>^ ptsTip,
	[OutAttribute] String^% pbstrText
)

Parameters

pTextLayer
Type: Microsoft.VisualStudio.TextManager.Interop::IVsTextLayer^

[in] An IVsTextLayer object representing the text file.

ptsSel
Type: array<Microsoft.VisualStudio.TextManager.Interop::TextSpan>^

[in] Span of text relevant to the specified text layer. For more information, see TextSpan.

ptsTip
Type: array<Microsoft.VisualStudio.TextManager.Interop::TextSpan>^

[out] Returns a span of text to center the tip over. For more information, see Microsoft.VisualStudio.TextManager.Interop.

pbstrText
Type: System::String^

[out] Returns the text of the tip to display.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From textmgr.idl:

HRESULT IVsLanguageTextOps::GetDataTip(
   [in] IVsTextLayer *pTextLayer, 
   [in] const TextSpan *ptsSel, 
   [out] TextSpan *ptsTip, 
   [out, retval] BSTR *pbstrText
);

Use the IVsTextLayer object to access the applicable text within the text span (ptsSel) for the tip.

What is displayed depends on the language service. For example, in Visual C#, holding the cursor over a variable typically shows the type of that variable. This method is also used with when debugging a program: this method is called to obtain the type and name of a variable while the debugger is asked for the value of the variable. The two pieces of information are then combined and displayed in a single data tip.

Return to top
Show: