pub enum CompletionContext {
Show 26 variants
General,
PropertyAccess {
object: String,
},
FunctionCall {
function: String,
arg_context: ArgumentContext,
},
PatternBody,
Query {
query_type: String,
},
PatternReference,
TypeAnnotation,
Annotation,
AnnotationArgs {
annotation: String,
},
ImportModule,
FromModule,
FromModulePartial {
prefix: String,
},
ImportItems {
module: String,
},
PipeTarget {
pipe_input_type: Option<String>,
},
ImplBlock {
trait_name: String,
target_type: String,
existing_methods: Vec<String>,
},
TypeAliasOverride {
base_type: String,
},
JoinStrategy,
JoinBody {
strategy: String,
},
TraitBound,
ComptimeBlock,
ExprAnnotation,
DocTag {
prefix: String,
},
DocParamName {
prefix: String,
},
DocTypeParamName {
prefix: String,
},
DocLinkTarget {
prefix: String,
},
InterpolationFormatSpec {
spec_prefix: String,
},
}Expand description
Completion context based on cursor position
Variants§
General
General context - show all completions
PropertyAccess
After a dot operator - show properties/methods
FunctionCall
Inside a function call - show parameters
Fields
arg_context: ArgumentContextDetailed argument context
PatternBody
Inside a pattern definition
Query
Inside a query (find, scan, etc.)
PatternReference
After “pattern” keyword - suggest pattern names
TypeAnnotation
Type annotation context
Annotation
After typing “@” at function/pattern start
AnnotationArgs
Inside annotation arguments @foo(|)
ImportModule
After “use “ — suggest extension modules for namespace import
FromModule
After “from “ — suggest importable modules for named import
FromModulePartial
After “from
ImportItems
Inside “from
PipeTarget
After pipe operator |> — suggest functions/methods that accept the piped type
ImplBlock
Inside an impl block body — suggest unimplemented trait methods
Fields
TypeAliasOverride
Inside a type alias override: type EUR = Currency { | }
Suggests comptime field names from the base type
JoinStrategy
After await join — suggest join strategies (all, race, any, settle)
JoinBody
Inside a join block body — suggest labeled branch snippets
TraitBound
In a trait bound position: fn foo<T: |> — suggest trait names
ComptimeBlock
Inside a comptime { } block — suggest comptime builtins + normal expressions
ExprAnnotation
After @ in expression position — suggest annotations for expression-level decoration
DocTag
After @ inside a /// doc comment.
DocParamName
In a @param doc tag.
DocTypeParamName
In a @typeparam doc tag.
DocLinkTarget
In a @see or @link doc tag target.
InterpolationFormatSpec
Inside formatted interpolation spec after expr: in f"{expr:...}".
Trait Implementations§
Source§impl Clone for CompletionContext
impl Clone for CompletionContext
Source§fn clone(&self) -> CompletionContext
fn clone(&self) -> CompletionContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompletionContext
impl Debug for CompletionContext
Source§impl PartialEq for CompletionContext
impl PartialEq for CompletionContext
impl StructuralPartialEq for CompletionContext
Auto Trait Implementations§
impl Freeze for CompletionContext
impl RefUnwindSafe for CompletionContext
impl Send for CompletionContext
impl Sync for CompletionContext
impl Unpin for CompletionContext
impl UnsafeUnpin 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
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>
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>
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