pub enum CompletionContext {
PackageName {
prefix: String,
range: Range,
},
Version {
package_name: PackageName,
prefix: String,
},
Feature {
package_name: PackageName,
prefix: String,
},
None,
}Expand description
Context for completion request based on cursor position.
This enum represents what type of completion is appropriate at the current cursor location within a manifest file.
Variants§
PackageName
Cursor is within or after a package name.
Example: serd| or tokio| where | represents cursor position.
Fields
§
range: RangeRange of the full package-name token, to be replaced by the completion’s
textEdit (not just the already-typed prefix up to the cursor).
Version
Cursor is within a version string.
Example: "1.0|" or "^2.|" where | represents cursor position.
Fields
§
package_name: PackageNamePackage name this version belongs to.
Feature
Cursor is within a feature array.
Example: features = ["deri|"] where | represents cursor position.
Fields
§
package_name: PackageNamePackage name whose features are being completed.
None
Cursor is not in a valid completion position.
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 (const: unstable) · 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 CompletionContext
impl Debug for CompletionContext
impl Eq for CompletionContext
Source§impl PartialEq for CompletionContext
impl PartialEq for CompletionContext
Source§fn eq(&self, other: &CompletionContext) -> bool
fn eq(&self, other: &CompletionContext) -> bool
Tests for
self and other values to be equal, and is used by ==.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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.