@@ -2,10 +2,8 @@ use enumflags2::{BitFlags, bitflags};
2
2
use std:: borrow:: Cow ;
3
3
4
4
#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
5
- #[ cfg_attr(
6
- feature = "serde" ,
7
- derive( serde:: Serialize , serde:: Deserialize , schemars:: JsonSchema )
8
- ) ]
5
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
6
+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
9
7
pub enum RuleCategory {
10
8
/// This rule performs static analysis of the source code to detect
11
9
/// invalid or error-prone patterns, and emits diagnostics along with
@@ -26,10 +24,8 @@ pub const SUPPRESSION_ACTION_CATEGORY: &str = "quickfix.suppressRule";
26
24
///
27
25
/// [CodeActionKind]: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionKind
28
26
#[ derive( Clone , Debug , PartialEq , Eq ) ]
29
- #[ cfg_attr(
30
- feature = "serde" ,
31
- derive( serde:: Serialize , serde:: Deserialize , schemars:: JsonSchema )
32
- ) ]
27
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
28
+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
33
29
pub enum ActionCategory {
34
30
/// Base kind for quickfix actions: 'quickfix'.
35
31
///
@@ -110,10 +106,8 @@ impl ActionCategory {
110
106
///
111
107
/// [Check the LSP spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionKind) for more information:
112
108
#[ derive( Clone , Debug , PartialEq , Eq ) ]
113
- #[ cfg_attr(
114
- feature = "serde" ,
115
- derive( serde:: Serialize , serde:: Deserialize , schemars:: JsonSchema )
116
- ) ]
109
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
110
+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
117
111
pub enum RefactorKind {
118
112
/// This action describes a refactor with no particular sub-category
119
113
None ,
@@ -150,10 +144,8 @@ pub enum RefactorKind {
150
144
151
145
/// The sub-category of a source code action
152
146
#[ derive( Clone , Debug , PartialEq , Eq ) ]
153
- #[ cfg_attr(
154
- feature = "serde" ,
155
- derive( serde:: Serialize , serde:: Deserialize , schemars:: JsonSchema )
156
- ) ]
147
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
148
+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
157
149
pub enum SourceActionKind {
158
150
/// This action describes a source action with no particular sub-category
159
151
None ,
@@ -282,7 +274,7 @@ impl<'de> serde::Deserialize<'de> for RuleCategories {
282
274
}
283
275
}
284
276
285
- #[ cfg( feature = "serde " ) ]
277
+ #[ cfg( feature = "schema " ) ]
286
278
impl schemars:: JsonSchema for RuleCategories {
287
279
fn schema_name ( ) -> String {
288
280
String :: from ( "RuleCategories" )
0 commit comments