PythonCompletionProvider Class
Provides IntelliPrompt completion data for the Python
language.
public class PythonCompletionProvider : CompletionProviderBase, ICompletionProvider, IOrderable, IKeyedObject, IEditorDocumentTextChangeEventSink
- Inheritance:
- object CompletionProviderBase object
Constructors
PythonCompletionProvider()
Initializes a new instance of the PythonCompletionProvider
class.
public PythonCompletionProvider()
Properties
DocstringDisplayMode
Gets or sets the docstring display mode within description tips.
public PythonDocstringDisplayMode DocstringDisplayMode { get; set; }
Property Value
- PythonDocstringDisplayMode:
A PythonDocstringDisplayMode that indicates the docstring display mode within description tips.
Methods
CreateContext(IEditorView)
Creates an IPythonContext for the caret's offset in the specified IEditorView.
protected virtual IPythonContext CreateContext(IEditorView view)
Parameter | Type | Description |
---|---|---|
view | IEditorView | The IEditorView to examine. |
Returns
- IPythonContext:
An IPythonContext for the caret's offset in the specified IEditorView.
OnDocumentTextChanged(SyntaxEditor, EditorSnapshotChangedEventArgs)
Occurs after a text change occurs to an IEditorDocument that uses this language.
protected virtual void OnDocumentTextChanged(SyntaxEditor editor, EditorSnapshotChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
editor | SyntaxEditor | The SyntaxEditor whose IEditorDocument is changed. |
e | EditorSnapshotChangedEventArgs | The |
OnDocumentTextChanging(SyntaxEditor, EditorSnapshotChangingEventArgs)
Occurs before a text change occurs to an IEditorDocument that uses this language.
protected virtual void OnDocumentTextChanging(SyntaxEditor editor, EditorSnapshotChangingEventArgs e)
Parameter | Type | Description |
---|---|---|
editor | SyntaxEditor | The SyntaxEditor whose IEditorDocument that is changing. |
e | EditorSnapshotChangingEventArgs | The |
OnSessionOpening(ICompletionSession)
Allows an inheritor to modify, filter and sort automatically-generated items before the specified ICompletionSession is opened and displayed to the end user. The session may also be cancelled.
protected virtual bool OnSessionOpening(ICompletionSession session)
Parameter | Type | Description |
---|---|---|
session | ICompletionSession | The ICompletionSession about to be opened. |
Returns
- bool:
true
if the session is allowed to open; otherwise,false
.
Remarks
The default implementation of this method sorts the items in the session.
RequestSession(IEditorView, bool)
Requests that an ICompletionSession be opened for the specified IEditorView.
public override bool RequestSession(IEditorView view, bool canCommitWithoutPopup)
Parameter | Type | Description |
---|---|---|
view | IEditorView | The IEditorView that will host the session. |
canCommitWithoutPopup | bool | Whether the session can immediately commit if a single match is made when the session is opened, commonly known as "complete word" functionality. |
Returns
- bool:
true
if a session was opened; otherwise,false
.