pub struct CompletionCx {
pub doc: DocId,
pub revision: u64,
pub position: Point,
pub word: Range<u32>,
pub lookback: String,
pub trigger: CompletionTrigger,
}Expand description
A revision-stamped request context — everything a provider may read. Complete by construction: the provider never touches the document.
Fields§
§doc: DocIdWhich document the request is for (multi-tab guard — replies never cross).
revision: u64The document revision the request was snapshotted at.
position: PointCaret, clipped to a char boundary so a byte offset never splits a glyph.
word: Range<u32>Absolute byte range of the completion word under the caret (empty at a
boundary), computed with is_completion_word_char — the default
replace range on accept.
lookback: StringRaw text from the start of row position.row − (LOOKBACK_LINES − 1)
(clamped to 0) up to and truncated at the caret. Deliberately
unsanitized — stripping comments and strings is the classifier’s own
first step, so it receives the text verbatim.
trigger: CompletionTriggerWhat caused this request (drives the classifier’s dispatch ladder).
Trait Implementations§
Source§impl Clone for CompletionCx
impl Clone for CompletionCx
Source§fn clone(&self) -> CompletionCx
fn clone(&self) -> CompletionCx
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more