ICodeSnippetProvider Interface
Provides the base requirements for an object that can manage the available code snippets and handle requests for display of IntelliPrompt code snippet sessions.
public interface ICodeSnippetProvider : IOrderable, IKeyedObject
Remarks
Objects implementing this provider interface can be registered as a service with an ISyntaxLanguage using the RegisterService(object, object) method. Any object implementing this interface will be called as needed by the language in priority order (based on IOrderable settings).
Properties
IsCaseSensitive
Gets whether code snippet shortcut matching requires a case-sensitive match.
bool IsCaseSensitive { get; }
Property Value
- bool:
true
if code snippet shortcut matching requires a case-sensitive match; otherwise,false
. The default value istrue
.
RootFolder
Gets the root ICodeSnippetFolder containing code snippets that are accessible by this provider.
ICodeSnippetFolder RootFolder { get; }
Property Value
- ICodeSnippetFolder:
The root ICodeSnippetFolder containing code snippets that are accessible by this provider.
Methods
RequestSelectionSession(IEditorView, CodeSnippetTypes)
Requests that an ICodeSnippetSelectionSession be opened for the specified IEditorView.
bool RequestSelectionSession(IEditorView view, CodeSnippetTypes snippetType)
Parameter | Type | Description |
---|---|---|
view | IEditorView | The IEditorView that will host the session. |
snippetType | CodeSnippetTypes | A CodeSnippetTypes indicating the type of code snippets to include. |
Returns
- bool:
true
if a session was opened; otherwise,false
.
RequestTemplateSession(IEditorView, ICodeSnippet)
Requests that an ICodeSnippetTemplateSession be opened for the specified IEditorView.
bool RequestTemplateSession(IEditorView view, ICodeSnippet codeSnippet)
Parameter | Type | Description |
---|---|---|
view | IEditorView | The IEditorView that will host the session. |
codeSnippet | ICodeSnippet | The ICodeSnippet template to use. |
Returns
- bool:
true
if a session was opened; otherwise,false
.