Compartir a través de


IVsLanguageTextOps.GetDataTip Method

Definition

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

public:
 int GetDataTip(Microsoft::VisualStudio::TextManager::Interop::IVsTextLayer ^ pTextLayer, cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ ptsSel, cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ ptsTip, [Runtime::InteropServices::Out] System::String ^ % pbstrText);
int GetDataTip(Microsoft::VisualStudio::TextManager::Interop::IVsTextLayer const & pTextLayer, std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & ptsSel, std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & ptsTip, [Runtime::InteropServices::Out] std::wstring const & & pbstrText);
public int GetDataTip (Microsoft.VisualStudio.TextManager.Interop.IVsTextLayer pTextLayer, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] ptsSel, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] ptsTip, out string pbstrText);
abstract member GetDataTip : Microsoft.VisualStudio.TextManager.Interop.IVsTextLayer * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] * string -> int
Public Function GetDataTip (pTextLayer As IVsTextLayer, ptsSel As TextSpan(), ptsTip As TextSpan(), ByRef pbstrText As String) As Integer

Parameters

pTextLayer
IVsTextLayer

[in] An IVsTextLayer object representing the text file.

ptsSel
TextSpan[]

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

ptsTip
TextSpan[]

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

pbstrText
String

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

Returns

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

Remarks

COM Signature

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.

Applies to