aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/diagnostics/test_data
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-01-15 17:11:54 +0000
committerJonas Schievink <[email protected]>2021-01-15 17:11:54 +0000
commit36500fe49630f0ac29e57ff1af737b2bd7bff5a8 (patch)
tree8444807099e9ec907235fabb431c072a8ecc81d4 /crates/rust-analyzer/src/diagnostics/test_data
parent0c58aa9dc0e24f0fa6a6ee7eb0c35041dedddb0a (diff)
Don't duplicate rustc diagnostics fixes
Diffstat (limited to 'crates/rust-analyzer/src/diagnostics/test_data')
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt47
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt47
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt47
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt120
4 files changed, 5 insertions, 256 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 23d42b4d0..5c282fe67 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
@@ -66,52 +66,7 @@
66 ), 66 ),
67 data: None, 67 data: None,
68 }, 68 },
69 fixes: [ 69 fixes: [],
70 CodeAction {
71 title: "consider prefixing with an underscore",
72 group: None,
73 kind: Some(
74 CodeActionKind(
75 "quickfix",
76 ),
77 ),
78 edit: Some(
79 SnippetWorkspaceEdit {
80 changes: Some(
81 {
82 Url {
83 scheme: "file",
84 host: None,
85 port: None,
86 path: "/test/driver/subcommand/repl.rs",
87 query: None,
88 fragment: None,
89 }: [
90 TextEdit {
91 range: Range {
92 start: Position {
93 line: 290,
94 character: 8,
95 },
96 end: Position {
97 line: 290,
98 character: 11,
99 },
100 },
101 new_text: "_foo",
102 },
103 ],
104 },
105 ),
106 document_changes: None,
107 },
108 ),
109 is_preferred: Some(
110 true,
111 ),
112 data: None,
113 },
114 ],
115 }, 70 },
116 MappedRustDiagnostic { 71 MappedRustDiagnostic {
117 url: Url { 72 url: Url {
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 4e428bedc..d36d7693d 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
@@ -66,52 +66,7 @@
66 ), 66 ),
67 data: None, 67 data: None,
68 }, 68 },
69 fixes: [ 69 fixes: [],
70 CodeAction {
71 title: "consider prefixing with an underscore",
72 group: None,
73 kind: Some(
74 CodeActionKind(
75 "quickfix",
76 ),
77 ),
78 edit: Some(
79 SnippetWorkspaceEdit {
80 changes: Some(
81 {
82 Url {
83 scheme: "file",
84 host: None,
85 port: None,
86 path: "/test/driver/subcommand/repl.rs",
87 query: None,
88 fragment: None,
89 }: [
90 TextEdit {
91 range: Range {
92 start: Position {
93 line: 290,
94 character: 8,
95 },
96 end: Position {
97 line: 290,
98 character: 11,
99 },
100 },
101 new_text: "_foo",
102 },
103 ],
104 },
105 ),
106 document_changes: None,
107 },
108 ),
109 is_preferred: Some(
110 true,
111 ),
112 data: None,
113 },
114 ],
115 }, 70 },
116 MappedRustDiagnostic { 71 MappedRustDiagnostic {
117 url: Url { 72 url: Url {
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 4ddd7efae..17845b711 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
@@ -66,52 +66,7 @@
66 ), 66 ),
67 data: None, 67 data: None,
68 }, 68 },
69 fixes: [ 69 fixes: [],
70 CodeAction {
71 title: "consider prefixing with an underscore",
72 group: None,
73 kind: Some(
74 CodeActionKind(
75 "quickfix",
76 ),
77 ),
78 edit: Some(
79 SnippetWorkspaceEdit {
80 changes: Some(
81 {
82 Url {
83 scheme: "file",
84 host: None,
85 port: None,
86 path: "/test/driver/subcommand/repl.rs",
87 query: None,
88 fragment: None,
89 }: [
90 TextEdit {
91 range: Range {
92 start: Position {
93 line: 290,
94 character: 8,
95 },
96 end: Position {
97 line: 290,
98 character: 11,
99 },
100 },
101 new_text: "_foo",
102 },
103 ],
104 },
105 ),
106 document_changes: None,
107 },
108 ),
109 is_preferred: Some(
110 true,
111 ),
112 data: None,
113 },
114 ],
115 }, 70 },
116 MappedRustDiagnostic { 71 MappedRustDiagnostic {
117 url: Url { 72 url: Url {
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 4cbdb3b92..a19962167 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
@@ -102,65 +102,7 @@
102 tags: None, 102 tags: None,
103 data: None, 103 data: None,
104 }, 104 },
105 fixes: [ 105 fixes: [],
106 CodeAction {
107 title: "return the expression directly",
108 group: None,
109 kind: Some(
110 CodeActionKind(
111 "quickfix",
112 ),
113 ),
114 edit: Some(
115 SnippetWorkspaceEdit {
116 changes: Some(
117 {
118 Url {
119 scheme: "file",
120 host: None,
121 port: None,
122 path: "/test/src/main.rs",
123 query: None,
124 fragment: None,
125 }: [
126 TextEdit {
127 range: Range {
128 start: Position {
129 line: 2,
130 character: 4,
131 },
132 end: Position {
133 line: 2,
134 character: 30,
135 },
136 },
137 new_text: "",
138 },
139 TextEdit {
140 range: Range {
141 start: Position {
142 line: 3,
143 character: 4,
144 },
145 end: Position {
146 line: 3,
147 character: 5,
148 },
149 },
150 new_text: "(0..10).collect()",
151 },
152 ],
153 },
154 ),
155 document_changes: None,
156 },
157 ),
158 is_preferred: Some(
159 true,
160 ),
161 data: None,
162 },
163 ],
164 }, 106 },
165 MappedRustDiagnostic { 107 MappedRustDiagnostic {
166 url: Url { 108 url: Url {
@@ -242,65 +184,7 @@
242 tags: None, 184 tags: None,
243 data: None, 185 data: None,
244 }, 186 },
245 fixes: [ 187 fixes: [],
246 CodeAction {
247 title: "return the expression directly",
248 group: None,
249 kind: Some(
250 CodeActionKind(
251 "quickfix",
252 ),
253 ),
254 edit: Some(
255 SnippetWorkspaceEdit {
256 changes: Some(
257 {
258 Url {
259 scheme: "file",
260 host: None,
261 port: None,
262 path: "/test/src/main.rs",
263 query: None,
264 fragment: None,
265 }: [
266 TextEdit {
267 range: Range {
268 start: Position {
269 line: 2,
270 character: 4,
271 },
272 end: Position {
273 line: 2,
274 character: 30,
275 },
276 },
277 new_text: "",
278 },
279 TextEdit {
280 range: Range {
281 start: Position {
282 line: 3,
283 character: 4,
284 },
285 end: Position {
286 line: 3,
287 character: 5,
288 },
289 },
290 new_text: "(0..10).collect()",
291 },
292 ],
293 },
294 ),
295 document_changes: None,
296 },
297 ),
298 is_preferred: Some(
299 true,
300 ),
301 data: None,
302 },
303 ],
304 }, 188 },
305 MappedRustDiagnostic { 189 MappedRustDiagnostic {
306 url: Url { 190 url: Url {