@@ -27,14 +27,7 @@ pub fn lint_to_code_actions<'a>(
27
27
source : & ' a [ char ] ,
28
28
config : & CodeActionConfig ,
29
29
) -> Vec < CodeActionOrCommand > {
30
- let mut results = vec ! [ CodeActionOrCommand :: Command ( Command {
31
- title: "Ignore grammatical error." . to_owned( ) ,
32
- command: "HarperIgnoreLint" . to_owned( ) ,
33
- arguments: Some ( vec![
34
- serde_json:: Value :: String ( url. to_string( ) ) ,
35
- serde_json:: to_value( lint) . unwrap( ) ,
36
- ] ) ,
37
- } ) ] ;
30
+ let mut results = Vec :: new ( ) ;
38
31
39
32
results. extend (
40
33
lint. suggestions
@@ -76,6 +69,15 @@ pub fn lint_to_code_actions<'a>(
76
69
. map ( CodeActionOrCommand :: CodeAction ) ,
77
70
) ;
78
71
72
+ results. push ( CodeActionOrCommand :: Command ( Command {
73
+ title : "Ignore Harper error." . to_owned ( ) ,
74
+ command : "HarperIgnoreLint" . to_owned ( ) ,
75
+ arguments : Some ( vec ! [
76
+ serde_json:: Value :: String ( url. to_string( ) ) ,
77
+ serde_json:: to_value( lint) . unwrap( ) ,
78
+ ] ) ,
79
+ } ) ) ;
80
+
79
81
if lint. lint_kind . is_spelling ( ) {
80
82
let orig = lint. span . get_content_string ( source) ;
81
83
@@ -90,10 +92,10 @@ pub fn lint_to_code_actions<'a>(
90
92
"HarperAddToFileDict" . to_string ( ) ,
91
93
Some ( vec ! [ orig. into( ) , url. to_string( ) . into( ) ] ) ,
92
94
) ) ) ;
95
+ }
93
96
94
- if config. force_stable {
95
- results. reverse ( ) ;
96
- }
97
+ if config. force_stable {
98
+ results. reverse ( ) ;
97
99
}
98
100
99
101
results
0 commit comments