pub enum CompletionScope {
Buffer,
Global,
}Expand description
The source to search for completion candidates.
Variants§
Buffer
Only use completion candidates from the current buffer.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let ct = CompletionType::Line(CompletionScope::Buffer);
let style = CompletionStyle::Prefix;
let display = CompletionDisplay::List;
let act: Action = EditorAction::Complete(style, ct, display).into();
assert_eq!(act, action!("complete -s prefix -T (line buffer) -D list"));Global
Use completion candidates available from all buffers.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let ct = CompletionType::Line(CompletionScope::Global);
let style = CompletionStyle::Prefix;
let display = CompletionDisplay::List;
let act: Action = EditorAction::Complete(style, ct, display).into();
assert_eq!(act, action!("complete -s prefix -T (line global) -D list"));Trait Implementations§
Source§impl Clone for CompletionScope
impl Clone for CompletionScope
Source§fn clone(&self) -> CompletionScope
fn clone(&self) -> CompletionScope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletionScope
impl Debug for CompletionScope
Source§impl PartialEq for CompletionScope
impl PartialEq for CompletionScope
impl Eq for CompletionScope
impl StructuralPartialEq for CompletionScope
Auto Trait Implementations§
impl Freeze for CompletionScope
impl RefUnwindSafe for CompletionScope
impl Send for CompletionScope
impl Sync for CompletionScope
impl Unpin for CompletionScope
impl UnwindSafe for CompletionScope
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