pub trait AutocompleteProvider {
// Required methods
fn trigger_characters(&self) -> &[char];
fn get_suggestions(
&self,
lines: &[String],
cursor_line: usize,
cursor_col: usize,
force: bool,
) -> Option<AutocompleteSuggestions>;
fn apply_completion(
&self,
lines: &[String],
cursor_line: usize,
cursor_col: usize,
item: &AutocompleteItem,
prefix: &str,
) -> (Vec<String>, usize, usize);
fn should_trigger_file_completion(
&self,
lines: &[String],
cursor_line: usize,
cursor_col: usize,
) -> bool;
}Expand description
Provider that generates autocomplete suggestions.
Required Methods§
Sourcefn trigger_characters(&self) -> &[char]
fn trigger_characters(&self) -> &[char]
Characters that should naturally trigger this provider at token boundaries.
Sourcefn get_suggestions(
&self,
lines: &[String],
cursor_line: usize,
cursor_col: usize,
force: bool,
) -> Option<AutocompleteSuggestions>
fn get_suggestions( &self, lines: &[String], cursor_line: usize, cursor_col: usize, force: bool, ) -> Option<AutocompleteSuggestions>
Get suggestions for the current text/cursor position. Returns None if no suggestions available.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".