pub struct CodeActionContext {
pub diagnostics: Vec<Diagnostic>,
pub only: Option<Vec<CodeActionKind>>,
pub trigger_kind: Option<CodeActionTriggerKind>,
}Expand description
Contains additional diagnostic information about the context in which
a [code action][CodeActionProvider::provideCodeActions] is run.
Fields§
§diagnostics: Vec<Diagnostic>An array of diagnostics known on the client side overlapping the range provided to the
textDocument/codeAction request. They are provided so that the server knows which
errors are currently presented to the user for the given range. There is no guarantee
that these accurately reflect the error state of the resource. The primary parameter
to compute code actions is the provided range.
only: Option<Vec<CodeActionKind>>Requested kind of actions to return.
Actions not of this kind are filtered out by the client before being shown. So servers can omit computing them.
trigger_kind: Option<CodeActionTriggerKind>The reason why code actions were requested.
@since 3.17.0
Implementations§
Source§impl CodeActionContext
impl CodeActionContext
pub const fn new( diagnostics: Vec<Diagnostic>, only: Option<Vec<CodeActionKind>>, trigger_kind: Option<CodeActionTriggerKind>, ) -> Self
Trait Implementations§
Source§impl Clone for CodeActionContext
impl Clone for CodeActionContext
Source§fn clone(&self) -> CodeActionContext
fn clone(&self) -> CodeActionContext
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 CodeActionContext
impl Debug for CodeActionContext
Source§impl Default for CodeActionContext
impl Default for CodeActionContext
Source§fn default() -> CodeActionContext
fn default() -> CodeActionContext
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CodeActionContext
impl<'de> Deserialize<'de> for CodeActionContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CodeActionContext
impl PartialEq for CodeActionContext
Source§fn eq(&self, other: &CodeActionContext) -> bool
fn eq(&self, other: &CodeActionContext) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CodeActionContext
impl Serialize for CodeActionContext
impl Eq for CodeActionContext
impl StructuralPartialEq for CodeActionContext
Auto Trait Implementations§
impl Freeze for CodeActionContext
impl RefUnwindSafe for CodeActionContext
impl Send for CodeActionContext
impl Sync for CodeActionContext
impl Unpin for CodeActionContext
impl UnsafeUnpin for CodeActionContext
impl UnwindSafe for CodeActionContext
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