Struct lsp2::CodeActionKind
pub struct CodeActionKind(_);
Implementations§
§impl CodeActionKind
impl CodeActionKind
pub const EMPTY: CodeActionKind = CodeActionKind::new("")
pub const EMPTY: CodeActionKind = CodeActionKind::new("")
Empty kind.
pub const QUICKFIX: CodeActionKind = CodeActionKind::new("quickfix")
pub const QUICKFIX: CodeActionKind = CodeActionKind::new("quickfix")
Base kind for quickfix actions: ‘quickfix’
pub const REFACTOR: CodeActionKind = CodeActionKind::new("refactor")
pub const REFACTOR: CodeActionKind = CodeActionKind::new("refactor")
Base kind for refactoring actions: ‘refactor’
pub const REFACTOR_EXTRACT: CodeActionKind = CodeActionKind::new("refactor.extract")
pub const REFACTOR_EXTRACT: CodeActionKind = CodeActionKind::new("refactor.extract")
Base kind for refactoring extraction actions: ‘refactor.extract’
Example extract actions:
- Extract method
- Extract function
- Extract variable
- Extract interface from class
- …
pub const REFACTOR_INLINE: CodeActionKind = CodeActionKind::new("refactor.inline")
pub const REFACTOR_INLINE: CodeActionKind = CodeActionKind::new("refactor.inline")
Base kind for refactoring inline actions: ‘refactor.inline’
Example inline actions:
- Inline function
- Inline variable
- Inline constant
- …
pub const REFACTOR_REWRITE: CodeActionKind = CodeActionKind::new("refactor.rewrite")
pub const REFACTOR_REWRITE: CodeActionKind = CodeActionKind::new("refactor.rewrite")
Base kind for refactoring rewrite actions: ‘refactor.rewrite’
Example rewrite actions:
- Convert JavaScript function to class
- Add or remove parameter
- Encapsulate field
- Make method static
- Move method to base class
- …
pub const SOURCE: CodeActionKind = CodeActionKind::new("source")
pub const SOURCE: CodeActionKind = CodeActionKind::new("source")
Base kind for source actions: source
Source code actions apply to the entire file.
pub const SOURCE_ORGANIZE_IMPORTS: CodeActionKind = CodeActionKind::new("source.organizeImports")
pub const SOURCE_ORGANIZE_IMPORTS: CodeActionKind = CodeActionKind::new("source.organizeImports")
Base kind for an organize imports source action: source.organizeImports
pub const SOURCE_FIX_ALL: CodeActionKind = CodeActionKind::new("source.fixAll")
pub const SOURCE_FIX_ALL: CodeActionKind = CodeActionKind::new("source.fixAll")
Base kind for a ‘fix all’ source action: source.fixAll
.
‘Fix all’ actions automatically fix errors that have a clear fix that do not require user input. They should not suppress errors or perform unsafe fixes such as generating new types or classes.
@since 3.17.0
pub const fn new(tag: &'static str) -> CodeActionKind
pub fn as_str(&self) -> &str
Trait Implementations§
§impl Clone for CodeActionKind
impl Clone for CodeActionKind
§fn clone(&self) -> CodeActionKind
fn clone(&self) -> CodeActionKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for CodeActionKind
impl Debug for CodeActionKind
§impl<'de> Deserialize<'de> for CodeActionKind
impl<'de> Deserialize<'de> for CodeActionKind
§fn deserialize<__D>(
__deserializer: __D
) -> Result<CodeActionKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<CodeActionKind, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl From<&'static str> for CodeActionKind
impl From<&'static str> for CodeActionKind
§fn from(from: &'static str) -> CodeActionKind
fn from(from: &'static str) -> CodeActionKind
§impl From<String> for CodeActionKind
impl From<String> for CodeActionKind
§fn from(from: String) -> CodeActionKind
fn from(from: String) -> CodeActionKind
§impl Hash for CodeActionKind
impl Hash for CodeActionKind
§impl PartialEq<CodeActionKind> for CodeActionKind
impl PartialEq<CodeActionKind> for CodeActionKind
§fn eq(&self, other: &CodeActionKind) -> bool
fn eq(&self, other: &CodeActionKind) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd<CodeActionKind> for CodeActionKind
impl PartialOrd<CodeActionKind> for CodeActionKind
§fn partial_cmp(&self, other: &CodeActionKind) -> Option<Ordering>
fn partial_cmp(&self, other: &CodeActionKind) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§impl Serialize for CodeActionKind
impl Serialize for CodeActionKind
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
impl Eq for CodeActionKind
impl StructuralEq for CodeActionKind
impl StructuralPartialEq for CodeActionKind
Auto Trait Implementations§
impl RefUnwindSafe for CodeActionKind
impl Send for CodeActionKind
impl Sync for CodeActionKind
impl Unpin for CodeActionKind
impl UnwindSafe for CodeActionKind
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.