1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/// The kind of a code action.
///
/// Kinds are a hierarchical list of identifiers separated by `.`, e.g. `"refactor.extract.function"`.
///
/// The set of kinds is open and client needs to announce the kinds it supports to the server during
/// initialization.
#[derive(Debug, Serialize)]
pub enum CodeActionKind {
    /// Base kind for quickfix actions: 'quickfix'
    QuickFix,

    /// Base kind for refactoring actions: 'refactor'
    Refactor,

    /// Base kind for refactoring extraction actions: 'refactor.extract'
    ///
    /// Example extract actions:
    ///
    /// - Extract method
    /// - Extract function
    /// - Extract variable
    /// - Extract interface from class
    /// - ...
    RefactorExtract,

    /// Base kind for refactoring inline actions: 'refactor.inline'
    ///
    /// Example inline actions:
    ///
    /// - Inline function
    /// - Inline variable
    /// - Inline constant
    /// - ...
    RefactorInline,

    /// 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
    /// - ...
    RefactorRewrite,

    /// Base kind for source actions: `source`
    ///
    /// Source code actions apply to the entire file.
    Source,

    /// Base kind for an organize imports source action: `source.organizeImports`
    SourceOrganizeImports,
}