diff --git a/crates/ide-assists/src/handlers/bool_to_enum.rs b/crates/ide-assists/src/handlers/bool_to_enum.rs index cd5fe0f86269..c035c59ffca6 100644 --- a/crates/ide-assists/src/handlers/bool_to_enum.rs +++ b/crates/ide-assists/src/handlers/bool_to_enum.rs @@ -1095,6 +1095,7 @@ fn main() { #[test] fn field_enum_cross_file() { + // FIXME: The import is missing check_assist( bool_to_enum, r#" @@ -1132,7 +1133,7 @@ fn foo() { } //- /main.rs -use foo::{Bool, Foo}; +use foo::Foo; mod foo; diff --git a/crates/ide-completion/src/render.rs b/crates/ide-completion/src/render.rs index ff5ec3a29f3e..2ac5d28f6920 100644 --- a/crates/ide-completion/src/render.rs +++ b/crates/ide-completion/src/render.rs @@ -1867,8 +1867,8 @@ fn f() { A { bar: b$0 }; } expect![[r#" fn bar() [type+name] fn baz() [type] - ex baz() [type] ex bar() [type] + ex baz() [type] st A [] fn f() [] "#]], diff --git a/crates/ide/src/annotations.rs b/crates/ide/src/annotations.rs index 8e0166a4a76c..121a463c9f15 100644 --- a/crates/ide/src/annotations.rs +++ b/crates/ide/src/annotations.rs @@ -286,6 +286,20 @@ fn main() { ), }, }, + Annotation { + range: 53..57, + kind: HasReferences { + pos: FilePositionWrapper { + file_id: FileId( + 0, + ), + offset: 53, + }, + data: Some( + [], + ), + }, + }, Annotation { range: 53..57, kind: Runnable( @@ -305,20 +319,6 @@ fn main() { }, ), }, - Annotation { - range: 53..57, - kind: HasReferences { - pos: FilePositionWrapper { - file_id: FileId( - 0, - ), - offset: 53, - }, - data: Some( - [], - ), - }, - }, ] "#]], ); @@ -336,6 +336,20 @@ fn main() { "#, expect![[r#" [ + Annotation { + range: 7..11, + kind: HasImpls { + pos: FilePositionWrapper { + file_id: FileId( + 0, + ), + offset: 7, + }, + data: Some( + [], + ), + }, + }, Annotation { range: 7..11, kind: HasReferences { @@ -358,13 +372,13 @@ fn main() { }, }, Annotation { - range: 7..11, - kind: HasImpls { + range: 17..21, + kind: HasReferences { pos: FilePositionWrapper { file_id: FileId( 0, ), - offset: 7, + offset: 17, }, data: Some( [], @@ -390,20 +404,6 @@ fn main() { }, ), }, - Annotation { - range: 17..21, - kind: HasReferences { - pos: FilePositionWrapper { - file_id: FileId( - 0, - ), - offset: 17, - }, - data: Some( - [], - ), - }, - }, ] "#]], ); @@ -427,7 +427,7 @@ fn main() { [ Annotation { range: 7..11, - kind: HasReferences { + kind: HasImpls { pos: FilePositionWrapper { file_id: FileId( 0, @@ -436,17 +436,14 @@ fn main() { }, data: Some( [ - FileRangeWrapper { - file_id: FileId( - 0, - ), - range: 57..61, - }, - FileRangeWrapper { + NavigationTarget { file_id: FileId( 0, ), - range: 93..97, + full_range: 36..64, + focus_range: 57..61, + name: "impl", + kind: Impl, }, ], ), @@ -454,7 +451,7 @@ fn main() { }, Annotation { range: 7..11, - kind: HasImpls { + kind: HasReferences { pos: FilePositionWrapper { file_id: FileId( 0, @@ -463,14 +460,17 @@ fn main() { }, data: Some( [ - NavigationTarget { + FileRangeWrapper { file_id: FileId( 0, ), - full_range: 36..64, - focus_range: 57..61, - name: "impl", - kind: Impl, + range: 57..61, + }, + FileRangeWrapper { + file_id: FileId( + 0, + ), + range: 93..97, }, ], ), @@ -521,20 +521,6 @@ fn main() { ), }, }, - Annotation { - range: 69..73, - kind: HasReferences { - pos: FilePositionWrapper { - file_id: FileId( - 0, - ), - offset: 69, - }, - data: Some( - [], - ), - }, - }, Annotation { range: 69..73, kind: Runnable( @@ -554,6 +540,20 @@ fn main() { }, ), }, + Annotation { + range: 69..73, + kind: HasReferences { + pos: FilePositionWrapper { + file_id: FileId( + 0, + ), + offset: 69, + }, + data: Some( + [], + ), + }, + }, ] "#]], ); @@ -567,6 +567,20 @@ fn main() {} "#, expect![[r#" [ + Annotation { + range: 3..7, + kind: HasReferences { + pos: FilePositionWrapper { + file_id: FileId( + 0, + ), + offset: 3, + }, + data: Some( + [], + ), + }, + }, Annotation { range: 3..7, kind: Runnable( @@ -586,20 +600,6 @@ fn main() {} }, ), }, - Annotation { - range: 3..7, - kind: HasReferences { - pos: FilePositionWrapper { - file_id: FileId( - 0, - ), - offset: 3, - }, - data: Some( - [], - ), - }, - }, ] "#]], ); @@ -623,7 +623,7 @@ fn main() { [ Annotation { range: 7..11, - kind: HasReferences { + kind: HasImpls { pos: FilePositionWrapper { file_id: FileId( 0, @@ -632,17 +632,14 @@ fn main() { }, data: Some( [ - FileRangeWrapper { - file_id: FileId( - 0, - ), - range: 19..23, - }, - FileRangeWrapper { + NavigationTarget { file_id: FileId( 0, ), - range: 74..78, + full_range: 14..56, + focus_range: 19..23, + name: "impl", + kind: Impl, }, ], ), @@ -650,7 +647,7 @@ fn main() { }, Annotation { range: 7..11, - kind: HasImpls { + kind: HasReferences { pos: FilePositionWrapper { file_id: FileId( 0, @@ -659,14 +656,17 @@ fn main() { }, data: Some( [ - NavigationTarget { + FileRangeWrapper { file_id: FileId( 0, ), - full_range: 14..56, - focus_range: 19..23, - name: "impl", - kind: Impl, + range: 19..23, + }, + FileRangeWrapper { + file_id: FileId( + 0, + ), + range: 74..78, }, ], ), @@ -693,20 +693,6 @@ fn main() { ), }, }, - Annotation { - range: 61..65, - kind: HasReferences { - pos: FilePositionWrapper { - file_id: FileId( - 0, - ), - offset: 61, - }, - data: Some( - [], - ), - }, - }, Annotation { range: 61..65, kind: Runnable( @@ -726,6 +712,20 @@ fn main() { }, ), }, + Annotation { + range: 61..65, + kind: HasReferences { + pos: FilePositionWrapper { + file_id: FileId( + 0, + ), + offset: 61, + }, + data: Some( + [], + ), + }, + }, ] "#]], ); @@ -744,20 +744,6 @@ mod tests { "#, expect![[r#" [ - Annotation { - range: 3..7, - kind: HasReferences { - pos: FilePositionWrapper { - file_id: FileId( - 0, - ), - offset: 3, - }, - data: Some( - [], - ), - }, - }, Annotation { range: 3..7, kind: Runnable( @@ -777,6 +763,20 @@ mod tests { }, ), }, + Annotation { + range: 3..7, + kind: HasReferences { + pos: FilePositionWrapper { + file_id: FileId( + 0, + ), + offset: 3, + }, + data: Some( + [], + ), + }, + }, Annotation { range: 18..23, kind: Runnable( @@ -876,7 +876,7 @@ struct Foo; [ Annotation { range: 0..71, - kind: HasReferences { + kind: HasImpls { pos: FilePositionWrapper { file_id: FileId( 0, @@ -890,7 +890,7 @@ struct Foo; }, Annotation { range: 0..71, - kind: HasImpls { + kind: HasReferences { pos: FilePositionWrapper { file_id: FileId( 0, diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs index 38dc522789d7..3bbbd36c1b1a 100644 --- a/crates/ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs @@ -1350,18 +1350,18 @@ mod tests { file_id: FileId( 0, ), - full_range: 121..185, - focus_range: 136..145, - name: "foo2_test", + full_range: 52..115, + focus_range: 67..75, + name: "foo_test", kind: Function, }, NavigationTarget { file_id: FileId( 0, ), - full_range: 52..115, - focus_range: 67..75, - name: "foo_test", + full_range: 121..185, + focus_range: 136..145, + name: "foo2_test", kind: Function, }, ] diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_rainbow.html b/crates/ide/src/syntax_highlighting/test_data/highlight_rainbow.html index 5d51b1497895..a4449b5d8d8e 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_rainbow.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_rainbow.html @@ -46,14 +46,14 @@ .unresolved_reference { color: #FC5555; text-decoration: wavy underline; }
fn main() {
- let hello = "hello";
- let x = hello.to_string();
- let y = hello.to_string();
+ let hello = "hello";
+ let x = hello.to_string();
+ let y = hello.to_string();
- let x = "other color please!";
- let y = x.to_string();
+ let x = "other color please!";
+ let y = x.to_string();
}
fn bar() {
- let mut hello = "hello";
+ let mut hello = "hello";
}
\ No newline at end of file
diff --git a/crates/mbe/src/benchmark.rs b/crates/mbe/src/benchmark.rs
index 43604eb232dc..8e769810aa26 100644
--- a/crates/mbe/src/benchmark.rs
+++ b/crates/mbe/src/benchmark.rs
@@ -55,7 +55,7 @@ fn benchmark_expand_macro_rules() {
})
.sum()
};
- assert_eq!(hash, 69413);
+ assert_eq!(hash, 76353);
}
fn macro_rules_fixtures() -> FxHashMap