pub struct CompletionContext {
pub buffer_id: usize,
pub file_path: Option<String>,
pub cursor_row: u32,
pub cursor_col: u32,
pub line: String,
pub prefix: String,
pub word_start_col: u32,
pub trigger_char: Option<char>,
}Expand description
Context for completion requests
Fields§
§buffer_id: usizeBuffer ID being completed
file_path: Option<String>File path (for language detection)
cursor_row: u32Current cursor row (0-indexed)
cursor_col: u32Current cursor column (0-indexed)
line: StringCurrent line content
prefix: StringPrefix text being completed
word_start_col: u32Column where the word being completed starts
trigger_char: Option<char>Character that triggered completion (if any)
Implementations§
Source§impl CompletionContext
impl CompletionContext
Sourcepub fn new(
buffer_id: usize,
cursor_row: u32,
cursor_col: u32,
line: String,
prefix: String,
word_start_col: u32,
) -> CompletionContext
pub fn new( buffer_id: usize, cursor_row: u32, cursor_col: u32, line: String, prefix: String, word_start_col: u32, ) -> CompletionContext
Create a new completion context
Sourcepub fn with_file_path(self, path: impl Into<String>) -> CompletionContext
pub fn with_file_path(self, path: impl Into<String>) -> CompletionContext
Set file path
Sourcepub const fn with_trigger_char(self, ch: char) -> CompletionContext
pub const fn with_trigger_char(self, ch: char) -> CompletionContext
Set trigger character
Trait Implementations§
Source§impl Clone for CompletionContext
impl Clone for CompletionContext
Source§fn clone(&self) -> CompletionContext
fn clone(&self) -> CompletionContext
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 moreAuto Trait Implementations§
impl Freeze for CompletionContext
impl RefUnwindSafe for CompletionContext
impl Send for CompletionContext
impl Sync for CompletionContext
impl Unpin for CompletionContext
impl UnwindSafe for CompletionContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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