pub struct Completer { /* private fields */ }Expand description
Code-completer with pop-up above CodeEditor. In future releases will be replaced with trait.
Implementations§
Source§impl Completer
impl Completer
Sourcepub fn new_with_syntax(syntax: &Syntax) -> Self
pub fn new_with_syntax(syntax: &Syntax) -> Self
Completer shoud be stored somewhere in your App struct.
pub fn with_user_words(self) -> Self
pub fn push_word(&mut self, word: &str)
Sourcepub fn handle_input(&mut self, ctx: &Context)
pub fn handle_input(&mut self, ctx: &Context)
If using Completer without CodeEditor this method should be called before text-editing widget. Up/Down arrows for selection, Tab for completion, Esc for hiding
Sourcepub fn show(
&mut self,
syntax: &Syntax,
theme: &ColorTheme,
fontsize: f32,
editor_output: &mut TextEditOutput,
)
pub fn show( &mut self, syntax: &Syntax, theme: &ColorTheme, fontsize: f32, editor_output: &mut TextEditOutput, )
If using Completer without CodeEditor this method should be called after text-editing widget as it uses &mut TextEditOutput
Sourcepub fn show_on_text_widget(
&mut self,
ui: &mut Ui,
syntax: &Syntax,
theme: &ColorTheme,
widget: impl FnMut(&mut Ui) -> TextEditOutput,
) -> TextEditOutput
pub fn show_on_text_widget( &mut self, ui: &mut Ui, syntax: &Syntax, theme: &ColorTheme, widget: impl FnMut(&mut Ui) -> TextEditOutput, ) -> TextEditOutput
Completer on text-editing widget, see demo for example
Trait Implementations§
impl StructuralPartialEq for Completer
Auto Trait Implementations§
impl Freeze for Completer
impl RefUnwindSafe for Completer
impl Send for Completer
impl Sync for Completer
impl Unpin for Completer
impl UnwindSafe for Completer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more