DelimiterAutoCompleter Class
Provides a default implementation for an IDelimiterAutoCompleter that can perform delimiter auto-completion.
public class DelimiterAutoCompleter : IDelimiterAutoCompleter, IEditorDocumentTextChangeEventSink, IEditorViewSelectionChangeEventSink, IEditorViewTextInputEventSink
- Inheritance:
- object object
- Implements:
- IDelimiterAutoCompleter IEditorDocumentTextChangeEventSink IEditorViewSelectionChangeEventSink IEditorViewTextInputEventSink
Remarks
Instances of this object can be registered with an ISyntaxLanguage using the RegisterService(object, object) method. Once an instance is registered with the language for the IDelimiterAutoCompleter interface type, its features can be used by the language.
Constructors
DelimiterAutoCompleter()
Initializes an instance of the class.
public DelimiterAutoCompleter()
Properties
CanCompleteAngleBraces
Indicates whether angle braces can be completed.
public bool CanCompleteAngleBraces { get; set; }
Property Value
- bool:
trueif angle braces can be completed; otherwise,false. The default value isfalse.
CanCompleteCurlyBraces
Indicates whether curly braces can be completed.
public bool CanCompleteCurlyBraces { get; set; }
Property Value
- bool:
trueif curly braces can be completed; otherwise,false. The default value istrue.
CanCompleteDoubleQuotes
Indicates whether double quotes can be completed.
public bool CanCompleteDoubleQuotes { get; set; }
Property Value
- bool:
trueif double quotes can be completed; otherwise,false. The default value istrue.
CanCompleteParentheses
Indicates whether parentheses can be completed.
public bool CanCompleteParentheses { get; set; }
Property Value
- bool:
trueif parentheses can be completed; otherwise,false. The default value istrue.
CanCompleteSingleQuotes
Indicates whether single quotes can be completed.
public bool CanCompleteSingleQuotes { get; set; }
Property Value
- bool:
trueif single quotes can be completed; otherwise,false. The default value isfalse.
CanCompleteSquareBraces
Indicates whether square braces can be completed.
public bool CanCompleteSquareBraces { get; set; }
Property Value
- bool:
trueif square braces can be completed; otherwise,false. The default value istrue.
OpenAngleBraceTokenId
The optional token ID value used to ensure that an open angle brace character is valid for auto-completion.
public int? OpenAngleBraceTokenId { get; set; }
Property Value
- int?
Remarks
Leave the value null if token validation is not required for angle braces.
OpenCurlyBraceTokenId
The optional token ID value used to ensure that an open curly brace character is valid for auto-completion.
public int? OpenCurlyBraceTokenId { get; set; }
Property Value
- int?
Remarks
Leave the value null if token validation is not required for curly braces.
OpenDoubleQuoteTokenId
The optional token ID value used to ensure that an open double quote character is valid for auto-completion.
public int? OpenDoubleQuoteTokenId { get; set; }
Property Value
- int?
Remarks
Leave the value null if token validation is not required for double quotes.
OpenParenthesisTokenId
The optional token ID value used to ensure that an open parenthesis character is valid for auto-completion.
public int? OpenParenthesisTokenId { get; set; }
Property Value
- int?
Remarks
Leave the value null if token validation is not required for parentheses.
OpenSingleQuoteTokenId
The optional token ID value used to ensure that an open single quote character is valid for auto-completion.
public int? OpenSingleQuoteTokenId { get; set; }
Property Value
- int?
Remarks
Leave the value null if token validation is not required for single quotes.
OpenSquareBraceTokenId
The optional token ID value used to ensure that an open square brace character is valid for auto-completion.
public int? OpenSquareBraceTokenId { get; set; }
Property Value
- int?
Remarks
Leave the value null if token validation is not required for square braces.
Methods
IsValidForEndDelimiterAutoComplete(TextSnapshotOffset, char)
Returns whether an end delimiter is valid to be auto-inserted at the specified TextSnapshotOffset.
protected virtual bool IsValidForEndDelimiterAutoComplete(TextSnapshotOffset snapshotOffset, char endDelimiter)
| Parameter | Type | Description |
|---|---|---|
| snapshotOffset | TextSnapshotOffset | The TextSnapshotOffset at which to possibly auto-insert the delimiter. |
| endDelimiter | char | The end delimiter. |
Returns
- bool:
trueif the end delimiter is valid to be auto-inserted at the specified TextSnapshotOffset; otherwise,false.
IsValidStartDelimiter(ITextSnapshotReader?, char)
Returns whether an ITextSnapshotReader's current offset is immediately after the specified start delimiter.
protected virtual bool IsValidStartDelimiter(ITextSnapshotReader? reader, char startDelimiter)
| Parameter | Type | Description |
|---|---|---|
| reader | ITextSnapshotReader | The ITextSnapshotReader to examine. |
| startDelimiter | char | The start delimiter. |
Returns
- bool:
trueif the ITextSnapshotReader's current offset is immediately after the specified start delimiter; otherwise,false.
IsValidStartDelimiter(IToken, char)
Returns whether an IToken represents the specified start delimiter.
protected virtual bool IsValidStartDelimiter(IToken token, char startDelimiter)
| Parameter | Type | Description |
|---|---|---|
| token | IToken | The IToken to examine. |
| startDelimiter | char | The start delimiter. |
Returns
Remarks
The default implementation of this method compares the token ID to the IDs specified in the OpenAngleBraceTokenId, OpenCurlyBraceTokenId, OpenParenthesisTokenId, and OpenSquareBraceTokenId properties. This method is called by the default implementation of the IsValidForEndDelimiterAutoComplete(TextSnapshotOffset, char) method.
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 is changed. |
| e | EditorSnapshotChangingEventArgs | The |
OnViewSelectionChanged(IEditorView, EditorViewSelectionEventArgs)
Occurs when the selection is changed in the specified IEditorView.
protected virtual void OnViewSelectionChanged(IEditorView view, EditorViewSelectionEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| view | IEditorView | The IEditorView that received the event. |
| e | EditorViewSelectionEventArgs | The |
OnViewTextInput(IEditorView, TextCompositionEventArgs)
Occurs before text is input to the specified IEditorView.
protected virtual void OnViewTextInput(IEditorView view, TextCompositionEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| view | IEditorView | The IEditorView that received the event. |
| e | TextCompositionEventArgs | The |
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()