Freigeben über


VsExpansionManagerClass.InvokeInsertionUI Method

Definition

Shows an IntelliSense list of code snippets that can be inserted into the source through the provided IVsExpansionClient object.See InvokeInsertionUI(IVsTextView, IVsExpansionClient, Guid, String[], Int32, Int32, String[], Int32, Int32, String, String).

public:
 virtual int InvokeInsertionUI(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ pView, Microsoft::VisualStudio::TextManager::Interop::IVsExpansionClient ^ pClient, Guid guidLang, cli::array <System::String ^> ^ bstrTypes, int iCountTypes, int fIncludeNULLType, cli::array <System::String ^> ^ bstrKinds, int iCountKinds, int fIncludeNULLKind, System::String ^ bstrPrefixText, System::String ^ bstrCompletionChar) = Microsoft::VisualStudio::TextManager::Interop::IVsExpansionManager::InvokeInsertionUI;
public:
 virtual int InvokeInsertionUI(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ pView, Microsoft::VisualStudio::TextManager::Interop::IVsExpansionClient ^ pClient, Guid guidLang, cli::array <System::String ^> ^ bstrTypes, int iCountTypes, int fIncludeNULLType, cli::array <System::String ^> ^ bstrKinds, int iCountKinds, int fIncludeNULLKind, System::String ^ bstrPrefixText, System::String ^ bstrCompletionChar);
public virtual int InvokeInsertionUI (Microsoft.VisualStudio.TextManager.Interop.IVsTextView pView, Microsoft.VisualStudio.TextManager.Interop.IVsExpansionClient pClient, Guid guidLang, string[] bstrTypes, int iCountTypes, int fIncludeNULLType, string[] bstrKinds, int iCountKinds, int fIncludeNULLKind, string bstrPrefixText, string bstrCompletionChar);
abstract member InvokeInsertionUI : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * Microsoft.VisualStudio.TextManager.Interop.IVsExpansionClient * Guid * string[] * int * int * string[] * int * int * string * string -> int
override this.InvokeInsertionUI : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * Microsoft.VisualStudio.TextManager.Interop.IVsExpansionClient * Guid * string[] * int * int * string[] * int * int * string * string -> int
Public Overridable Function InvokeInsertionUI (pView As IVsTextView, pClient As IVsExpansionClient, guidLang As Guid, bstrTypes As String(), iCountTypes As Integer, fIncludeNULLType As Integer, bstrKinds As String(), iCountKinds As Integer, fIncludeNULLKind As Integer, bstrPrefixText As String, bstrCompletionChar As String) As Integer

Parameters

pView
IVsTextView

[in] An IVsTextView object representing the view in which to present the list.

pClient
IVsExpansionClient

[in] An IVsExpansionClient object representing the expansion client that is used to complete the insertion of the code snippet.

guidLang
Guid

[in] The GUID of the coding language (typically, this is the language service GUID).

bstrTypes
String[]

[in] An array strings specifying snippet types to display. This can be a null value if iCountTypes is 0. See Remarks.

iCountTypes
Int32

[in] The number of types specified in the bstrTypes array. If this is 0, all types are displayed.

fIncludeNULLType
Int32

[in] Non-zero (TRUE) if to include code snippets with "empty" types in the bstrTypes list (this parameter is ignored if iCountTypes is 0).

bstrKinds
String[]

[in] An array of strings specifying the snippet kinds to display. This can be a null value if iCountKinds is 0. See Remarks.

iCountKinds
Int32

[in] The number of kinds specified in the bstrKinds array. If this is 0, all kinds are displayed.

fIncludeNULLKind
Int32

[in] Non-zero (TRUE) if to include code snippets with "empty" kinds in the bstrKinds list (this parameter is ignored if iCountKinds is 0).

bstrPrefixText
String

[in] A string containing the text to show in the prompt.

bstrCompletionChar
String

[in] A character that, when typed, inserts the currently selected snippet and closes the UI. If this is a null value or an empty string, typing the Enter key is the only way to insert a selected snippet.

Returns

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

Implements

Remarks

COM Signature

From textmgr2.idl:

HRESULT IVsExpansionManager::InvokeInsertionUI(  
   [in] IVsTextView *pView,  
   [in]IVsExpansionClient *pClient,  
   [in]GUID guidLang,  
   [in, size_is(iCountTypes)] BSTR *bstrTypes,  
   [in] long iCountTypes,  
   [in] bool fIncludeNULLType,  
   [in, size_is(iCountKinds)] BSTR *bstrKinds,  
   [in] long iCountKinds,  
   [in] bool fIncludeNULLKind,  
   [in] BSTR bstrPrefixText,  
   [in] BSTR bstrCompletionChar  
);  

The bstrTypes list contains strings that specify the types of snippets to display. These types can be "Expansion" or "SurroundsWith" (see SnippetType Element (Intellisense Code Snippets) for details on snippet types). It is possible for a code snippet to not have a type associated with it, in which case such snippets are not displayed unless the fIncludeNULLType parameter is non-zero (TRUE) or the iCountTypes parameter is 0.

The bstrKinds list contains strings that specify the kinds of snippets to display, such as MethodBody, Page, and File. The snippet kind can control in what context the snippet is inserted. For example, a snippet kind of MethodBody should be inserted only in a method. See Code Element (Intellisense Code Snippets) for a list of all snippet kinds that are supported. It is possible for a code snippet to not have a kind associated with it, in which case such snippets are not displayed unless the fIncludeNULLKind parameter is non-zero (TRUE) or the iCountKinds parameter is 0.

Applies to