diff options
author | Aleksey Kladov <[email protected]> | 2020-11-10 17:20:01 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-11-10 17:48:46 +0000 |
commit | 7d2eb000b078143e9fa6225d00ef52fc7c606fdf (patch) | |
tree | 580d90bd250ffcd4b1c66570e5601761e58d1057 /crates/rust-analyzer/src/diagnostics | |
parent | ada5a88f8fd0a79af7ad6e0411acc1cce9ef32d5 (diff) |
Switch to upstream protocol for resolving code action
Note that we have to maintain custom implementation on the client
side: I don't see how to marry bulitin resolve support with groups and
snippets.
Diffstat (limited to 'crates/rust-analyzer/src/diagnostics')
5 files changed, 5 insertions, 5 deletions
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt index 8dc53391e..a8d85f008 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt | |||
@@ -36,7 +36,6 @@ | |||
36 | fixes: [ | 36 | fixes: [ |
37 | CodeAction { | 37 | CodeAction { |
38 | title: "consider prefixing with an underscore", | 38 | title: "consider prefixing with an underscore", |
39 | id: None, | ||
40 | group: None, | 39 | group: None, |
41 | kind: Some( | 40 | kind: Some( |
42 | CodeActionKind( | 41 | CodeActionKind( |
@@ -70,6 +69,7 @@ | |||
70 | is_preferred: Some( | 69 | is_preferred: Some( |
71 | true, | 70 | true, |
72 | ), | 71 | ), |
72 | data: None, | ||
73 | }, | 73 | }, |
74 | ], | 74 | ], |
75 | }, | 75 | }, |
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt index c8703194c..0b8937376 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt | |||
@@ -36,7 +36,6 @@ | |||
36 | fixes: [ | 36 | fixes: [ |
37 | CodeAction { | 37 | CodeAction { |
38 | title: "consider prefixing with an underscore", | 38 | title: "consider prefixing with an underscore", |
39 | id: None, | ||
40 | group: None, | 39 | group: None, |
41 | kind: Some( | 40 | kind: Some( |
42 | CodeActionKind( | 41 | CodeActionKind( |
@@ -70,6 +69,7 @@ | |||
70 | is_preferred: Some( | 69 | is_preferred: Some( |
71 | true, | 70 | true, |
72 | ), | 71 | ), |
72 | data: None, | ||
73 | }, | 73 | }, |
74 | ], | 74 | ], |
75 | }, | 75 | }, |
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt index dc93227ad..7fa9dee62 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt | |||
@@ -36,7 +36,6 @@ | |||
36 | fixes: [ | 36 | fixes: [ |
37 | CodeAction { | 37 | CodeAction { |
38 | title: "consider prefixing with an underscore", | 38 | title: "consider prefixing with an underscore", |
39 | id: None, | ||
40 | group: None, | 39 | group: None, |
41 | kind: Some( | 40 | kind: Some( |
42 | CodeActionKind( | 41 | CodeActionKind( |
@@ -70,6 +69,7 @@ | |||
70 | is_preferred: Some( | 69 | is_preferred: Some( |
71 | true, | 70 | true, |
72 | ), | 71 | ), |
72 | data: None, | ||
73 | }, | 73 | }, |
74 | ], | 74 | ], |
75 | }, | 75 | }, |
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt index 81f752672..3c97b2084 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt | |||
@@ -51,7 +51,6 @@ | |||
51 | fixes: [ | 51 | fixes: [ |
52 | CodeAction { | 52 | CodeAction { |
53 | title: "return the expression directly", | 53 | title: "return the expression directly", |
54 | id: None, | ||
55 | group: None, | 54 | group: None, |
56 | kind: Some( | 55 | kind: Some( |
57 | CodeActionKind( | 56 | CodeActionKind( |
@@ -98,6 +97,7 @@ | |||
98 | is_preferred: Some( | 97 | is_preferred: Some( |
99 | true, | 98 | true, |
100 | ), | 99 | ), |
100 | data: None, | ||
101 | }, | 101 | }, |
102 | ], | 102 | ], |
103 | }, | 103 | }, |
diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs index b949577c1..15145415b 100644 --- a/crates/rust-analyzer/src/diagnostics/to_proto.rs +++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs | |||
@@ -110,7 +110,6 @@ fn map_rust_child_diagnostic( | |||
110 | } else { | 110 | } else { |
111 | MappedRustChildDiagnostic::SuggestedFix(lsp_ext::CodeAction { | 111 | MappedRustChildDiagnostic::SuggestedFix(lsp_ext::CodeAction { |
112 | title: rd.message.clone(), | 112 | title: rd.message.clone(), |
113 | id: None, | ||
114 | group: None, | 113 | group: None, |
115 | kind: Some(lsp_types::CodeActionKind::QUICKFIX), | 114 | kind: Some(lsp_types::CodeActionKind::QUICKFIX), |
116 | edit: Some(lsp_ext::SnippetWorkspaceEdit { | 115 | edit: Some(lsp_ext::SnippetWorkspaceEdit { |
@@ -119,6 +118,7 @@ fn map_rust_child_diagnostic( | |||
119 | document_changes: None, | 118 | document_changes: None, |
120 | }), | 119 | }), |
121 | is_preferred: Some(true), | 120 | is_preferred: Some(true), |
121 | data: None, | ||
122 | }) | 122 | }) |
123 | } | 123 | } |
124 | } | 124 | } |