Struct IdeMenu

Source
pub struct IdeMenu { /* private fields */ }
Expand description

Menu to present suggestions like similar to Ide completion menus

Implementations§

Source§

impl IdeMenu

Source

pub fn with_min_completion_width(self, width: u16) -> Self

Menu builder with new value for min completion width

Source

pub fn with_max_completion_width(self, width: u16) -> Self

Menu builder with new value for max completion width

Source

pub fn with_max_completion_height(self, height: u16) -> Self

Menu builder with new value for max completion height

Source

pub fn with_padding(self, padding: u16) -> Self

Menu builder with new value for padding

Source

pub fn with_default_border(self) -> Self

Menu builder with the default border

Source

pub fn with_border( self, top_right: char, top_left: char, bottom_right: char, bottom_left: char, horizontal: char, vertical: char, ) -> Self

Menu builder with new value for border

Source

pub fn with_cursor_offset(self, cursor_offset: i16) -> Self

Menu builder with new value for cursor offset

Source

pub fn with_description_mode(self, description_mode: DescriptionMode) -> Self

Menu builder with new description mode

Source

pub fn with_min_description_width(self, min_description_width: u16) -> Self

Menu builder with new min description width

Source

pub fn with_max_description_width(self, max_description_width: u16) -> Self

Menu builder with new max description width

Source

pub fn with_max_description_height(self, max_description_height: u16) -> Self

Menu builder with new max description height

Source

pub fn with_description_offset(self, description_offset: u16) -> Self

Menu builder with new description offset

Source

pub fn with_correct_cursor_pos(self, correct_cursor_pos: bool) -> Self

Menu builder with new correct cursor pos

Trait Implementations§

Source§

impl Default for IdeMenu

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Menu for IdeMenu

Source§

fn settings(&self) -> &MenuSettings

Menu settings

Source§

fn is_active(&self) -> bool

Deactivates context menu

Source§

fn can_quick_complete(&self) -> bool

The ide menu can to quick complete if there is only one element

Source§

fn menu_event(&mut self, event: MenuEvent)

Selects what type of event happened with the menu

Source§

fn update_values(&mut self, editor: &mut Editor, completer: &mut dyn Completer)

Update menu values

Source§

fn update_working_details( &mut self, editor: &mut Editor, completer: &mut dyn Completer, painter: &Painter, )

The working details for the menu changes based on the size of the lines collected from the completer

Source§

fn replace_in_buffer(&self, editor: &mut Editor)

The buffer gets replaced in the Span location

Source§

fn min_rows(&self) -> u16

Minimum rows that should be displayed by the menu

Source§

fn can_partially_complete( &mut self, values_updated: bool, editor: &mut Editor, completer: &mut dyn Completer, ) -> bool

The completion menu can try to find the common string and replace it in the given line buffer
Source§

fn get_values(&self) -> &[Suggestion]

Gets cached values from menu that will be displayed
Source§

fn menu_required_lines(&self, _terminal_columns: u16) -> u16

Calculates the real required lines for the menu considering how many lines wrap the terminal or if entries have multiple lines
Source§

fn menu_string(&self, available_lines: u16, use_ansi_coloring: bool) -> String

Creates the menu representation as a string which will be painted by the painter
Source§

fn set_cursor_pos(&mut self, pos: (u16, u16))

Sets the position of the cursor (currently only required by the IDE menu)
Source§

fn name(&self) -> &str

Menu name
Source§

fn indicator(&self) -> &str

Menu indicator
Source§

impl MenuBuilder for IdeMenu

Source§

fn settings_mut(&mut self) -> &mut MenuSettings

Get mutable MenuSettings required for the builder functions
Source§

fn with_name(self, name: &str) -> Self

Menu builder with new name
Source§

fn with_text_style(self, color: Style) -> Self

Menu builder with new value for text style
Source§

fn with_selected_text_style(self, color: Style) -> Self

Menu builder with new value for selected text style
Source§

fn with_description_text_style(self, color: Style) -> Self

Menu builder with new value for description style
Source§

fn with_match_text_style(self, color: Style) -> Self

Menu builder with new value for match style This is the style of the part of the input text, the suggestions are based on
Source§

fn with_selected_match_text_style(self, color: Style) -> Self

Menu builder with new value for selected match style This is the style of the part of the input text, the suggestions are based on
Source§

fn with_marker(self, marker: &str) -> Self

Menu builder with new value for marker
Source§

fn with_only_buffer_difference(self, only_buffer_difference: bool) -> Self

Menu builder with new value for only_buffer_difference

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.