fix: Fix modules in blocks not resolving in ide layer

This commit is contained in:
Lukas Wirth 2024-02-26 13:51:24 +01:00
parent 5346002d07
commit 91554e0ae7
11 changed files with 183 additions and 33 deletions

View file

@ -993,10 +993,6 @@ pub struct Struct;
}
#[test]
#[cfg_attr(
not(all(unix, target_pointer_width = "64")),
ignore = "depends on `DefaultHasher` outputs"
)]
fn test_rainbow_highlighting() {
check_highlighting(
r#"
@ -1018,6 +1014,35 @@ fn bar() {
);
}
#[test]
fn test_block_mod_items() {
check_highlighting(
r#"
macro_rules! foo {
($foo:ident) => {
mod y {
struct $foo;
}
};
}
fn main() {
foo!(Foo);
mod module {
// FIXME: IDE layer has this unresolved
foo!(Bar);
fn func() {
mod inner {
struct Innerest<const C: usize> { field: [(); {C}] }
}
}
}
}
"#,
expect_file!["./test_data/highlight_block_mod_items.html"],
false,
);
}
#[test]
fn test_ranges() {
let (analysis, file_id) = fixture::file(