VsExpansionPackageClass::GetExpansionByShortcut Method (IVsExpansionClient^, Guid, String^, IVsTextView^, array<TextSpan>^, Int32, String^, String^)

 

Retrieves the title and path to a snippet given its shortcut name. See GetExpansionByShortcut.

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

public:
virtual int GetExpansionByShortcut(
	IVsExpansionClient^ pClient,
	Guid guidLang,
	String^ szShortcut,
	IVsTextView^ pView,
	array<TextSpan>^ pts,
	int fShowUI,
	[OutAttribute] String^% pszExpansionPath,
	[OutAttribute] String^% pszTitle
)

Parameters

pClient
Type: Microsoft.VisualStudio.TextManager.Interop::IVsExpansionClient^

[in] An IVsExpansionClient object representing the client that can control what code snippets can be inserted.

guidLang
Type: System::Guid

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

szShortcut
Type: System::String^

[in] A string containing the shortcut name of the snippet.

pView
Type: Microsoft.VisualStudio.TextManager.Interop::IVsTextView^

[in] An IVsTextView object used as the parent if the UI needs to be shown. This can be a null value if fShowUI is zero (FALSE).

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

[in] A TextSpan object that describes the span (position and extent) where the code snippet is to be inserted.

fShowUI
Type: System::Int32

[in] Non-zero (TRUE) if to show the UI to allow the user to choose among multiple snippets with the same shortcut name.

pszExpansionPath
Type: System::String^

[out] Returns a string containing the full path to the snippet.

pszTitle
Type: System::String^

[out] Returns a string containing the title of the snippet.

Return Value

Type: System::Int32

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

Return to top
Show: