use config::CompletionType;
use std::borrow::Cow::{self, Borrowed};
pub trait Highlighter {
fn highlight<'l>(&self, line: &'l str, pos: usize) -> Cow<'l, str> {
let _ = pos;
Borrowed(line)
}
fn highlight_prompt<'p>(&self, prompt: &'p str) -> Cow<'p, str> {
Borrowed(prompt)
}
#[deprecated(
since = "2.0.1",
note = "please use `highlight_prompt` instead"
)]
fn highlight_dynamic_prompt<'p>(&self, prompt: &'p str) -> Cow<'p, str> {
Borrowed(prompt)
}
fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str> {
Borrowed(hint)
}
fn highlight_candidate<'c>(
&self,
candidate: &'c str,
completion: CompletionType,
) -> Cow<'c, str> {
let _ = completion;
Borrowed(candidate)
}
fn highlight_char(&self, grapheme: &str) -> bool {
let _ = grapheme;
false
}
}
impl Highlighter for () {}