RegexCompletionItemMatcherBase Class
Represents an abstract object that can match completion items based on supplied text using a regular expression.
public abstract class RegexCompletionItemMatcherBase : CompletionItemMatcherBase, ICompletionItemMatcher, IKeyedObject
- Inheritance:
- System.Object CompletionItemMatcherBase Object
- Implements:
- ICompletionItemMatcher IKeyedObject
Constructors
RegexCompletionItemMatcherBase()
protected RegexCompletionItemMatcherBase()
Methods
GetHighlightedTextRanges(ICompletionSession, ICompletionItem, String)
Returns a collection of TextRange objects that specify the ranges of matched characters within an ICompletionItem's Text.
public override IEnumerable<TextRange> GetHighlightedTextRanges(ICompletionSession session, ICompletionItem item, string text)
Parameter | Type | Description |
---|---|---|
session | ICompletionSession | The ICompletionSession in which the match is to be made. |
item | ICompletionItem | The ICompletionItem against which to match. |
text | System.String | The text to use for matching. |
Returns
- System.Collections.Generic.IEnumerable<TextRange>:
A collection of TextRange objects that specify the ranges of matched characters within an ICompletionItem's Text.
GetRegex(String, Boolean)
Returns the System.Text.RegularExpressions.Regex to use for matching based on supplied text.
protected abstract Regex GetRegex(string text, bool captureMatches)
Parameter | Type | Description |
---|---|---|
text | System.String | The text for which to return a System.Text.RegularExpressions.Regex. |
captureMatches | System.Boolean | When |
Returns
- System.Text.RegularExpressions.Regex:
The System.Text.RegularExpressions.Regex that was created.
Match(ICompletionSession, IEnumerable, String, Boolean)
Attempts to locate an ICompletionItem match based on specified text.
public override CompletionSelection Match(ICompletionSession session, IEnumerable items, string text, bool uniqueFullMatchOnly)
Parameter | Type | Description |
---|---|---|
session | ICompletionSession | The ICompletionSession in which the match is to be made. |
items | System.Collections.IEnumerable | The collection of items against which to match. |
text | System.String | The text to use for matching. |
uniqueFullMatchOnly | System.Boolean | Whether to only return a match if it is a full and unique match. |
Returns
- CompletionSelection:
A CompletionSelection instance, if a match was made.
OnTextChanged(String)
Occurs when the text to match changes.
protected virtual void OnTextChanged(string text)
Parameter | Type | Description |
---|---|---|
text | System.String | The new text to match. |
Inherited Members
- CompletionItemMatcherBase.Key
- System.Object.ToString()
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()