aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/assists/src/handlers/generate_impl.rs25
-rw-r--r--crates/assists/src/handlers/move_module_to_file.rs47
-rw-r--r--crates/assists/src/utils.rs9
-rw-r--r--crates/ide/src/extend_selection.rs8
-rw-r--r--crates/ide_completion/src/completions/attribute.rs3
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt22
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt4
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt6
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt4
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt4
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt10
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt10
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt10
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt12
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt22
15 files changed, 190 insertions, 6 deletions
diff --git a/crates/assists/src/handlers/generate_impl.rs b/crates/assists/src/handlers/generate_impl.rs
index 16a600e6f..a8e3c4fc2 100644
--- a/crates/assists/src/handlers/generate_impl.rs
+++ b/crates/assists/src/handlers/generate_impl.rs
@@ -122,6 +122,31 @@ mod tests {
122 $0 122 $0
123 }"#, 123 }"#,
124 ); 124 );
125
126 check_assist(
127 generate_impl,
128 r#"pub trait Trait {}
129struct Struct<T>$0
130where
131 T: Trait,
132{
133 inner: T,
134}"#,
135 r#"pub trait Trait {}
136struct Struct<T>
137where
138 T: Trait,
139{
140 inner: T,
141}
142
143impl<T> Struct<T>
144where
145 T: Trait,
146{
147 $0
148}"#,
149 );
125 } 150 }
126 151
127 #[test] 152 #[test]
diff --git a/crates/assists/src/handlers/move_module_to_file.rs b/crates/assists/src/handlers/move_module_to_file.rs
index 9d8579f47..91c395c1b 100644
--- a/crates/assists/src/handlers/move_module_to_file.rs
+++ b/crates/assists/src/handlers/move_module_to_file.rs
@@ -1,5 +1,6 @@
1use ast::edit::IndentLevel; 1use ast::{edit::IndentLevel, VisibilityOwner};
2use ide_db::base_db::AnchoredPathBuf; 2use ide_db::base_db::AnchoredPathBuf;
3use stdx::format_to;
3use syntax::{ 4use syntax::{
4 ast::{self, edit::AstNodeEdit, NameOwner}, 5 ast::{self, edit::AstNodeEdit, NameOwner},
5 AstNode, TextRange, 6 AstNode, TextRange,
@@ -59,7 +60,13 @@ pub(crate) fn move_module_to_file(acc: &mut Assists, ctx: &AssistContext) -> Opt
59 items 60 items
60 }; 61 };
61 62
62 builder.replace(module_ast.syntax().text_range(), format!("mod {};", module_name)); 63 let mut buf = String::new();
64 if let Some(v) = module_ast.visibility() {
65 format_to!(buf, "{} ", v);
66 }
67 format_to!(buf, "mod {};", module_name);
68
69 builder.replace(module_ast.syntax().text_range(), buf);
63 70
64 let dst = AnchoredPathBuf { anchor: ctx.frange.file_id, path }; 71 let dst = AnchoredPathBuf { anchor: ctx.frange.file_id, path };
65 builder.create_file(dst, contents); 72 builder.create_file(dst, contents);
@@ -138,6 +145,42 @@ fn f() {}
138 } 145 }
139 146
140 #[test] 147 #[test]
148 fn extract_public() {
149 check_assist(
150 move_module_to_file,
151 r#"
152pub mod $0tests {
153 #[test] fn t() {}
154}
155"#,
156 r#"
157//- /main.rs
158pub mod tests;
159//- /tests.rs
160#[test] fn t() {}
161"#,
162 );
163 }
164
165 #[test]
166 fn extract_public_crate() {
167 check_assist(
168 move_module_to_file,
169 r#"
170pub(crate) mod $0tests {
171 #[test] fn t() {}
172}
173"#,
174 r#"
175//- /main.rs
176pub(crate) mod tests;
177//- /tests.rs
178#[test] fn t() {}
179"#,
180 );
181 }
182
183 #[test]
141 fn available_before_curly() { 184 fn available_before_curly() {
142 mark::check!(available_before_curly); 185 mark::check!(available_before_curly);
143 check_assist_not_applicable(move_module_to_file, r#"mod m { $0 }"#); 186 check_assist_not_applicable(move_module_to_file, r#"mod m { $0 }"#);
diff --git a/crates/assists/src/utils.rs b/crates/assists/src/utils.rs
index 8418e6e12..0074da741 100644
--- a/crates/assists/src/utils.rs
+++ b/crates/assists/src/utils.rs
@@ -421,7 +421,14 @@ fn generate_impl_text_inner(adt: &ast::Adt, trait_text: Option<&str>, code: &str
421 format_to!(buf, "<{}>", lifetime_params.chain(type_params).format(", ")) 421 format_to!(buf, "<{}>", lifetime_params.chain(type_params).format(", "))
422 } 422 }
423 423
424 format_to!(buf, " {{\n{}\n}}", code); 424 match adt.where_clause() {
425 Some(where_clause) => {
426 format_to!(buf, "\n{}\n{{\n{}\n}}", where_clause, code);
427 }
428 None => {
429 format_to!(buf, " {{\n{}\n}}", code);
430 }
431 }
425 432
426 buf 433 buf
427} 434}
diff --git a/crates/ide/src/extend_selection.rs b/crates/ide/src/extend_selection.rs
index 2d722dee0..b540d04fe 100644
--- a/crates/ide/src/extend_selection.rs
+++ b/crates/ide/src/extend_selection.rs
@@ -12,15 +12,17 @@ use syntax::{
12 12
13use crate::FileRange; 13use crate::FileRange;
14 14
15// Feature: Extend Selection 15// Feature: Expand and Shrink Selection
16// 16//
17// Extends the current selection to the encompassing syntactic construct 17// Extends or shrinks the current selection to the encompassing syntactic construct
18// (expression, statement, item, module, etc). It works with multiple cursors. 18// (expression, statement, item, module, etc). It works with multiple cursors.
19// 19//
20// This is a standard LSP feature and not a protocol extension.
21//
20// |=== 22// |===
21// | Editor | Shortcut 23// | Editor | Shortcut
22// 24//
23// | VS Code | kbd:[Ctrl+Shift+→] 25// | VS Code | kbd:[Alt+Shift+→], kbd:[Alt+Shift+←]
24// |=== 26// |===
25pub(crate) fn extend_selection(db: &RootDatabase, frange: FileRange) -> TextRange { 27pub(crate) fn extend_selection(db: &RootDatabase, frange: FileRange) -> TextRange {
26 let sema = Semantics::new(db); 28 let sema = Semantics::new(db);
diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs
index ab25a8c58..3a5bc4381 100644
--- a/crates/ide_completion/src/completions/attribute.rs
+++ b/crates/ide_completion/src/completions/attribute.rs
@@ -101,6 +101,7 @@ const ATTRIBUTES: &[AttrCompletion] = &[
101 ), 101 ),
102 attr(r#"doc(alias = "…")"#, Some("docalias"), Some(r#"doc(alias = "${0:docs}")"#)), 102 attr(r#"doc(alias = "…")"#, Some("docalias"), Some(r#"doc(alias = "${0:docs}")"#)),
103 attr(r#"doc = "…""#, Some("doc"), Some(r#"doc = "${0:docs}""#)), 103 attr(r#"doc = "…""#, Some("doc"), Some(r#"doc = "${0:docs}""#)),
104 attr(r#"doc(hidden)"#, Some("dochidden"), Some(r#"doc(hidden)"#)),
104 attr("feature(…)", Some("feature"), Some("feature(${0:flag})")).prefer_inner(), 105 attr("feature(…)", Some("feature"), Some("feature(${0:flag})")).prefer_inner(),
105 attr("forbid(…)", Some("forbid"), Some("forbid(${0:lint})")), 106 attr("forbid(…)", Some("forbid"), Some("forbid(${0:lint})")),
106 // FIXME: resolve through macro resolution? 107 // FIXME: resolve through macro resolution?
@@ -471,6 +472,7 @@ struct Test {}
471 at export_name = "…" 472 at export_name = "…"
472 at doc(alias = "…") 473 at doc(alias = "…")
473 at doc = "…" 474 at doc = "…"
475 at doc(hidden)
474 at forbid(…) 476 at forbid(…)
475 at ignore = "…" 477 at ignore = "…"
476 at inline 478 at inline
@@ -519,6 +521,7 @@ struct Test {}
519 at export_name = "…" 521 at export_name = "…"
520 at doc(alias = "…") 522 at doc(alias = "…")
521 at doc = "…" 523 at doc = "…"
524 at doc(hidden)
522 at feature(…) 525 at feature(…)
523 at forbid(…) 526 at forbid(…)
524 at global_allocator 527 at global_allocator
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt
index ce80476fb..23ec2efba 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/compiler/mir/tagset.rs", 9 path: "/test/compiler/mir/tagset.rs",
@@ -31,6 +33,8 @@
31 CodeDescription { 33 CodeDescription {
32 href: Url { 34 href: Url {
33 scheme: "https", 35 scheme: "https",
36 username: "",
37 password: None,
34 host: Some( 38 host: Some(
35 Domain( 39 Domain(
36 "rust-lang.github.io", 40 "rust-lang.github.io",
@@ -55,6 +59,8 @@
55 location: Location { 59 location: Location {
56 uri: Url { 60 uri: Url {
57 scheme: "file", 61 scheme: "file",
62 username: "",
63 password: None,
58 host: None, 64 host: None,
59 port: None, 65 port: None,
60 path: "/test/compiler/lib.rs", 66 path: "/test/compiler/lib.rs",
@@ -78,6 +84,8 @@
78 location: Location { 84 location: Location {
79 uri: Url { 85 uri: Url {
80 scheme: "file", 86 scheme: "file",
87 username: "",
88 password: None,
81 host: None, 89 host: None,
82 port: None, 90 port: None,
83 path: "/test/compiler/mir/tagset.rs", 91 path: "/test/compiler/mir/tagset.rs",
@@ -107,6 +115,8 @@
107 MappedRustDiagnostic { 115 MappedRustDiagnostic {
108 url: Url { 116 url: Url {
109 scheme: "file", 117 scheme: "file",
118 username: "",
119 password: None,
110 host: None, 120 host: None,
111 port: None, 121 port: None,
112 path: "/test/compiler/lib.rs", 122 path: "/test/compiler/lib.rs",
@@ -136,6 +146,8 @@
136 CodeDescription { 146 CodeDescription {
137 href: Url { 147 href: Url {
138 scheme: "https", 148 scheme: "https",
149 username: "",
150 password: None,
139 host: Some( 151 host: Some(
140 Domain( 152 Domain(
141 "rust-lang.github.io", 153 "rust-lang.github.io",
@@ -160,6 +172,8 @@
160 location: Location { 172 location: Location {
161 uri: Url { 173 uri: Url {
162 scheme: "file", 174 scheme: "file",
175 username: "",
176 password: None,
163 host: None, 177 host: None,
164 port: None, 178 port: None,
165 path: "/test/compiler/mir/tagset.rs", 179 path: "/test/compiler/mir/tagset.rs",
@@ -189,6 +203,8 @@
189 MappedRustDiagnostic { 203 MappedRustDiagnostic {
190 url: Url { 204 url: Url {
191 scheme: "file", 205 scheme: "file",
206 username: "",
207 password: None,
192 host: None, 208 host: None,
193 port: None, 209 port: None,
194 path: "/test/compiler/mir/tagset.rs", 210 path: "/test/compiler/mir/tagset.rs",
@@ -218,6 +234,8 @@
218 CodeDescription { 234 CodeDescription {
219 href: Url { 235 href: Url {
220 scheme: "https", 236 scheme: "https",
237 username: "",
238 password: None,
221 host: Some( 239 host: Some(
222 Domain( 240 Domain(
223 "rust-lang.github.io", 241 "rust-lang.github.io",
@@ -242,6 +260,8 @@
242 location: Location { 260 location: Location {
243 uri: Url { 261 uri: Url {
244 scheme: "file", 262 scheme: "file",
263 username: "",
264 password: None,
245 host: None, 265 host: None,
246 port: None, 266 port: None,
247 path: "/test/compiler/mir/tagset.rs", 267 path: "/test/compiler/mir/tagset.rs",
@@ -281,6 +301,8 @@
281 { 301 {
282 Url { 302 Url {
283 scheme: "file", 303 scheme: "file",
304 username: "",
305 password: None,
284 host: None, 306 host: None,
285 port: None, 307 port: None,
286 path: "/test/compiler/mir/tagset.rs", 308 path: "/test/compiler/mir/tagset.rs",
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt
index eb4a6b597..e5f01fb33 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/src/main.rs", 9 path: "/test/src/main.rs",
@@ -31,6 +33,8 @@
31 CodeDescription { 33 CodeDescription {
32 href: Url { 34 href: Url {
33 scheme: "https", 35 scheme: "https",
36 username: "",
37 password: None,
34 host: Some( 38 host: Some(
35 Domain( 39 Domain(
36 "doc.rust-lang.org", 40 "doc.rust-lang.org",
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
index bdcf2a38f..f999848a7 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/crates/hir_def/src/path.rs", 9 path: "/test/crates/hir_def/src/path.rs",
@@ -34,6 +36,8 @@
34 location: Location { 36 location: Location {
35 uri: Url { 37 uri: Url {
36 scheme: "file", 38 scheme: "file",
39 username: "",
40 password: None,
37 host: None, 41 host: None,
38 port: None, 42 port: None,
39 path: "/test/crates/hir_def/src/data.rs", 43 path: "/test/crates/hir_def/src/data.rs",
@@ -63,6 +67,8 @@
63 MappedRustDiagnostic { 67 MappedRustDiagnostic {
64 url: Url { 68 url: Url {
65 scheme: "file", 69 scheme: "file",
70 username: "",
71 password: None,
66 host: None, 72 host: None,
67 port: None, 73 port: None,
68 path: "/test/crates/hir_def/src/data.rs", 74 path: "/test/crates/hir_def/src/data.rs",
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt
index 19f72196d..0d16af232 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/compiler/ty/list_iter.rs", 9 path: "/test/compiler/ty/list_iter.rs",
@@ -31,6 +33,8 @@
31 CodeDescription { 33 CodeDescription {
32 href: Url { 34 href: Url {
33 scheme: "https", 35 scheme: "https",
36 username: "",
37 password: None,
34 host: Some( 38 host: Some(
35 Domain( 39 Domain(
36 "doc.rust-lang.org", 40 "doc.rust-lang.org",
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt
index 15ac95d72..31b6a12ce 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/runtime/compiler_support.rs", 9 path: "/test/runtime/compiler_support.rs",
@@ -31,6 +33,8 @@
31 CodeDescription { 33 CodeDescription {
32 href: Url { 34 href: Url {
33 scheme: "https", 35 scheme: "https",
36 username: "",
37 password: None,
34 host: Some( 38 host: Some(
35 Domain( 39 Domain(
36 "doc.rust-lang.org", 40 "doc.rust-lang.org",
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 5c282fe67..b6acb5f42 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
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/driver/subcommand/repl.rs", 9 path: "/test/driver/subcommand/repl.rs",
@@ -38,6 +40,8 @@
38 location: Location { 40 location: Location {
39 uri: Url { 41 uri: Url {
40 scheme: "file", 42 scheme: "file",
43 username: "",
44 password: None,
41 host: None, 45 host: None,
42 port: None, 46 port: None,
43 path: "/test/driver/subcommand/repl.rs", 47 path: "/test/driver/subcommand/repl.rs",
@@ -71,6 +75,8 @@
71 MappedRustDiagnostic { 75 MappedRustDiagnostic {
72 url: Url { 76 url: Url {
73 scheme: "file", 77 scheme: "file",
78 username: "",
79 password: None,
74 host: None, 80 host: None,
75 port: None, 81 port: None,
76 path: "/test/driver/subcommand/repl.rs", 82 path: "/test/driver/subcommand/repl.rs",
@@ -107,6 +113,8 @@
107 location: Location { 113 location: Location {
108 uri: Url { 114 uri: Url {
109 scheme: "file", 115 scheme: "file",
116 username: "",
117 password: None,
110 host: None, 118 host: None,
111 port: None, 119 port: None,
112 path: "/test/driver/subcommand/repl.rs", 120 path: "/test/driver/subcommand/repl.rs",
@@ -146,6 +154,8 @@
146 { 154 {
147 Url { 155 Url {
148 scheme: "file", 156 scheme: "file",
157 username: "",
158 password: None,
149 host: None, 159 host: None,
150 port: None, 160 port: None,
151 path: "/test/driver/subcommand/repl.rs", 161 path: "/test/driver/subcommand/repl.rs",
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 d36d7693d..d765257c4 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
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/driver/subcommand/repl.rs", 9 path: "/test/driver/subcommand/repl.rs",
@@ -38,6 +40,8 @@
38 location: Location { 40 location: Location {
39 uri: Url { 41 uri: Url {
40 scheme: "file", 42 scheme: "file",
43 username: "",
44 password: None,
41 host: None, 45 host: None,
42 port: None, 46 port: None,
43 path: "/test/driver/subcommand/repl.rs", 47 path: "/test/driver/subcommand/repl.rs",
@@ -71,6 +75,8 @@
71 MappedRustDiagnostic { 75 MappedRustDiagnostic {
72 url: Url { 76 url: Url {
73 scheme: "file", 77 scheme: "file",
78 username: "",
79 password: None,
74 host: None, 80 host: None,
75 port: None, 81 port: None,
76 path: "/test/driver/subcommand/repl.rs", 82 path: "/test/driver/subcommand/repl.rs",
@@ -107,6 +113,8 @@
107 location: Location { 113 location: Location {
108 uri: Url { 114 uri: Url {
109 scheme: "file", 115 scheme: "file",
116 username: "",
117 password: None,
110 host: None, 118 host: None,
111 port: None, 119 port: None,
112 path: "/test/driver/subcommand/repl.rs", 120 path: "/test/driver/subcommand/repl.rs",
@@ -146,6 +154,8 @@
146 { 154 {
147 Url { 155 Url {
148 scheme: "file", 156 scheme: "file",
157 username: "",
158 password: None,
149 host: None, 159 host: None,
150 port: None, 160 port: None,
151 path: "/test/driver/subcommand/repl.rs", 161 path: "/test/driver/subcommand/repl.rs",
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 17845b711..6b0d94878 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
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/driver/subcommand/repl.rs", 9 path: "/test/driver/subcommand/repl.rs",
@@ -38,6 +40,8 @@
38 location: Location { 40 location: Location {
39 uri: Url { 41 uri: Url {
40 scheme: "file", 42 scheme: "file",
43 username: "",
44 password: None,
41 host: None, 45 host: None,
42 port: None, 46 port: None,
43 path: "/test/driver/subcommand/repl.rs", 47 path: "/test/driver/subcommand/repl.rs",
@@ -71,6 +75,8 @@
71 MappedRustDiagnostic { 75 MappedRustDiagnostic {
72 url: Url { 76 url: Url {
73 scheme: "file", 77 scheme: "file",
78 username: "",
79 password: None,
74 host: None, 80 host: None,
75 port: None, 81 port: None,
76 path: "/test/driver/subcommand/repl.rs", 82 path: "/test/driver/subcommand/repl.rs",
@@ -107,6 +113,8 @@
107 location: Location { 113 location: Location {
108 uri: Url { 114 uri: Url {
109 scheme: "file", 115 scheme: "file",
116 username: "",
117 password: None,
110 host: None, 118 host: None,
111 port: None, 119 port: None,
112 path: "/test/driver/subcommand/repl.rs", 120 path: "/test/driver/subcommand/repl.rs",
@@ -146,6 +154,8 @@
146 { 154 {
147 Url { 155 Url {
148 scheme: "file", 156 scheme: "file",
157 username: "",
158 password: None,
149 host: None, 159 host: None,
150 port: None, 160 port: None,
151 path: "/test/driver/subcommand/repl.rs", 161 path: "/test/driver/subcommand/repl.rs",
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt
index f455cf25e..f7a313cf1 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/compiler/ty/select.rs", 9 path: "/test/compiler/ty/select.rs",
@@ -31,6 +33,8 @@
31 CodeDescription { 33 CodeDescription {
32 href: Url { 34 href: Url {
33 scheme: "https", 35 scheme: "https",
36 username: "",
37 password: None,
34 host: Some( 38 host: Some(
35 Domain( 39 Domain(
36 "doc.rust-lang.org", 40 "doc.rust-lang.org",
@@ -55,6 +59,8 @@
55 location: Location { 59 location: Location {
56 uri: Url { 60 uri: Url {
57 scheme: "file", 61 scheme: "file",
62 username: "",
63 password: None,
58 host: None, 64 host: None,
59 port: None, 65 port: None,
60 path: "/test/compiler/ty/select.rs", 66 path: "/test/compiler/ty/select.rs",
@@ -84,6 +90,8 @@
84 MappedRustDiagnostic { 90 MappedRustDiagnostic {
85 url: Url { 91 url: Url {
86 scheme: "file", 92 scheme: "file",
93 username: "",
94 password: None,
87 host: None, 95 host: None,
88 port: None, 96 port: None,
89 path: "/test/compiler/ty/select.rs", 97 path: "/test/compiler/ty/select.rs",
@@ -113,6 +121,8 @@
113 CodeDescription { 121 CodeDescription {
114 href: Url { 122 href: Url {
115 scheme: "https", 123 scheme: "https",
124 username: "",
125 password: None,
116 host: Some( 126 host: Some(
117 Domain( 127 Domain(
118 "doc.rust-lang.org", 128 "doc.rust-lang.org",
@@ -137,6 +147,8 @@
137 location: Location { 147 location: Location {
138 uri: Url { 148 uri: Url {
139 scheme: "file", 149 scheme: "file",
150 username: "",
151 password: None,
140 host: None, 152 host: None,
141 port: None, 153 port: None,
142 path: "/test/compiler/ty/select.rs", 154 path: "/test/compiler/ty/select.rs",
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 a19962167..a0cfb8d33 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
@@ -2,6 +2,8 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 username: "",
6 password: None,
5 host: None, 7 host: None,
6 port: None, 8 port: None,
7 path: "/test/src/main.rs", 9 path: "/test/src/main.rs",
@@ -31,6 +33,8 @@
31 CodeDescription { 33 CodeDescription {
32 href: Url { 34 href: Url {
33 scheme: "https", 35 scheme: "https",
36 username: "",
37 password: None,
34 host: Some( 38 host: Some(
35 Domain( 39 Domain(
36 "rust-lang.github.io", 40 "rust-lang.github.io",
@@ -55,6 +59,8 @@
55 location: Location { 59 location: Location {
56 uri: Url { 60 uri: Url {
57 scheme: "file", 61 scheme: "file",
62 username: "",
63 password: None,
58 host: None, 64 host: None,
59 port: None, 65 port: None,
60 path: "/test/src/main.rs", 66 path: "/test/src/main.rs",
@@ -78,6 +84,8 @@
78 location: Location { 84 location: Location {
79 uri: Url { 85 uri: Url {
80 scheme: "file", 86 scheme: "file",
87 username: "",
88 password: None,
81 host: None, 89 host: None,
82 port: None, 90 port: None,
83 path: "/test/src/main.rs", 91 path: "/test/src/main.rs",
@@ -107,6 +115,8 @@
107 MappedRustDiagnostic { 115 MappedRustDiagnostic {
108 url: Url { 116 url: Url {
109 scheme: "file", 117 scheme: "file",
118 username: "",
119 password: None,
110 host: None, 120 host: None,
111 port: None, 121 port: None,
112 path: "/test/src/main.rs", 122 path: "/test/src/main.rs",
@@ -136,6 +146,8 @@
136 CodeDescription { 146 CodeDescription {
137 href: Url { 147 href: Url {
138 scheme: "https", 148 scheme: "https",
149 username: "",
150 password: None,
139 host: Some( 151 host: Some(
140 Domain( 152 Domain(
141 "rust-lang.github.io", 153 "rust-lang.github.io",
@@ -160,6 +172,8 @@
160 location: Location { 172 location: Location {
161 uri: Url { 173 uri: Url {
162 scheme: "file", 174 scheme: "file",
175 username: "",
176 password: None,
163 host: None, 177 host: None,
164 port: None, 178 port: None,
165 path: "/test/src/main.rs", 179 path: "/test/src/main.rs",
@@ -189,6 +203,8 @@
189 MappedRustDiagnostic { 203 MappedRustDiagnostic {
190 url: Url { 204 url: Url {
191 scheme: "file", 205 scheme: "file",
206 username: "",
207 password: None,
192 host: None, 208 host: None,
193 port: None, 209 port: None,
194 path: "/test/src/main.rs", 210 path: "/test/src/main.rs",
@@ -218,6 +234,8 @@
218 CodeDescription { 234 CodeDescription {
219 href: Url { 235 href: Url {
220 scheme: "https", 236 scheme: "https",
237 username: "",
238 password: None,
221 host: Some( 239 host: Some(
222 Domain( 240 Domain(
223 "rust-lang.github.io", 241 "rust-lang.github.io",
@@ -242,6 +260,8 @@
242 location: Location { 260 location: Location {
243 uri: Url { 261 uri: Url {
244 scheme: "file", 262 scheme: "file",
263 username: "",
264 password: None,
245 host: None, 265 host: None,
246 port: None, 266 port: None,
247 path: "/test/src/main.rs", 267 path: "/test/src/main.rs",
@@ -281,6 +301,8 @@
281 { 301 {
282 Url { 302 Url {
283 scheme: "file", 303 scheme: "file",
304 username: "",
305 password: None,
284 host: None, 306 host: None,
285 port: None, 307 port: None,
286 path: "/test/src/main.rs", 308 path: "/test/src/main.rs",