Skip to main content

highlight_prefix

Function highlight_prefix 

Source
pub fn highlight_prefix(query: &str, item: &CompletionItem) -> Vec<Range<usize>>
Expand description

Highlight a prefix of the completion label, matching today’s menu.

The painted length is CompletionItem::filter_text when the item sets one, otherwise the query. It is shortened so the range never splits a character. An empty length paints nothing.