pub trait Hinter: Send {
// Required methods
fn handle(
&mut self,
line: &str,
pos: usize,
history: &dyn History,
use_ansi_coloring: bool
) -> String;
fn complete_hint(&self) -> String;
fn next_hint_token(&self) -> String;
}
Expand description
A trait that’s responsible for returning the hint for the current line and position Hints are often shown in-line as part of the buffer, showing the user text they can accept or ignore
Required Methods§
sourcefn handle(
&mut self,
line: &str,
pos: usize,
history: &dyn History,
use_ansi_coloring: bool
) -> String
fn handle( &mut self, line: &str, pos: usize, history: &dyn History, use_ansi_coloring: bool ) -> String
Handle the hinting duty by using the line, position, and current history
Returns the formatted output to show the user
sourcefn complete_hint(&self) -> String
fn complete_hint(&self) -> String
Return the current hint unformatted to perform the completion of the full hint
sourcefn next_hint_token(&self) -> String
fn next_hint_token(&self) -> String
Return the first semantic token of the hint for incremental completion