Table of Contents

Class PaletteFilters

Namespace
Whim.CommandPalette
Assembly
Whim.CommandPalette.dll
Utilities for palette filters.
public static class PaletteFilters
Inheritance
PaletteFilters
Inherited Members

Fields

MatchesFuzzyContiguous

Filter which returns contiguous matches of a word, compared to a given word to match against.
public static readonly PaletteFilter MatchesFuzzyContiguous

Field Value

PaletteFilter

MatchesFuzzySeparate

Filter which returns separate matches of a word, compared to a given word to match against.
public static readonly PaletteFilter MatchesFuzzySeparate

Field Value

PaletteFilter

MatchesWords

Filter which returns prefix, separate words, and contiguous string matches of a word, compared to a given word to match against.
public static readonly PaletteFilter MatchesWords

Field Value

PaletteFilter

Methods

Join(FilterTextMatch, FilterTextMatch[])

Returns an array with the tail concatenated to the end of the head. NOTE: This may mutate the provided tail.
public static FilterTextMatch[] Join(FilterTextMatch head, FilterTextMatch[] tail)

Parameters

head FilterTextMatch
The match to place at the start of the array of returned matches.
tail FilterTextMatch[]
The matches to place after the head.

Returns

FilterTextMatch[]

MatchesCamelCase(string, string)

Returns the matches for the word, where the word is a camel case substring of the wordToMatchAgainst.
public static FilterTextMatch[]? MatchesCamelCase(string word, string wordToMatchAgainst)

Parameters

word string
wordToMatchAgainst string

Returns

FilterTextMatch[]

MatchesContiguousSubString(string, string)

Returns the match of the word, where the word is a contiguous substring of the wordToMatchAgainst.
public static FilterTextMatch[]? MatchesContiguousSubString(string word, string wordToMatchAgainst)

Parameters

word string
wordToMatchAgainst string

Returns

FilterTextMatch[]

MatchesPrefix(string, string)

Returns exact prefix matches of the word, compared to the wordToMatchAgainst. Cases are ignored.
public static FilterTextMatch[]? MatchesPrefix(string word, string wordToMatchAgainst)

Parameters

word string
wordToMatchAgainst string

Returns

FilterTextMatch[]

MatchesRegex(string, string)

Returns matches of the word compared to the wordToMatchAgainst, where the word is a regular expression.
public static FilterTextMatch[]? MatchesRegex(string word, string wordToMatchAgainst)

Parameters

word string
wordToMatchAgainst string

Returns

FilterTextMatch[]

MatchesStrictPrefix(string, string)

Returns prefix matches of the word, compared to the wordToMatchAgainst. Cases are matched exactly.
public static FilterTextMatch[]? MatchesStrictPrefix(string word, string wordToMatchAgainst)

Parameters

word string
wordToMatchAgainst string

Returns

FilterTextMatch[]

MatchesSubString(string, string)

Returns the non-contiguous substring matches of the word, compared to the wordToMatchAgainst.
public static FilterTextMatch[]? MatchesSubString(string word, string wordToMatchAgainst)

Parameters

word string
wordToMatchAgainst string

Returns

FilterTextMatch[]

MatchesWordsContiguous(string, string)

Matches beginning of words supporting non-ASCII languages. Matches substrings of the word with beginnings of the words in the target. E.g., "gp" or "g p" will match "Git: Pull". Useful in cases where the target is words (e.g., command labels).
public static FilterTextMatch[]? MatchesWordsContiguous(string word, string target)

Parameters

word string
target string

Returns

FilterTextMatch[]

MatchesWordsSeparate(string, string)

Matches beginning of words supporting non-ASCII languages. Matches words with the beginnings of the words in the target. E.g., "pul" will match "Git: Pull".
public static FilterTextMatch[]? MatchesWordsSeparate(string word, string target)

Parameters

word string
target string

Returns

FilterTextMatch[]

Or(params PaletteFilter[])

Returns a filter which returns the matches for the first filter which returns a non-null value.
public static PaletteFilter Or(params PaletteFilter[] filters)

Parameters

filters PaletteFilter[]
The filters to iterate over.

Returns

PaletteFilter