mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-23 08:48:08 +00:00
Merge pull request #20976 from A4-Tacks/comp-after-top-inner-attr
Fix not complete after inner-attr in source-file
This commit is contained in:
commit
ffa9cfab3c
2 changed files with 35 additions and 1 deletions
|
|
@ -1635,7 +1635,7 @@ fn classify_name_ref<'db>(
|
|||
&& let Some(t) = top.first_token()
|
||||
&& let Some(prev) =
|
||||
t.prev_token().and_then(|t| syntax::algo::skip_trivia_token(t, Direction::Prev))
|
||||
&& ![T![;], T!['}'], T!['{']].contains(&prev.kind())
|
||||
&& ![T![;], T!['}'], T!['{'], T![']']].contains(&prev.kind())
|
||||
{
|
||||
// This was inferred to be an item position path, but it seems
|
||||
// to be part of some other broken node which leaked into an item
|
||||
|
|
|
|||
|
|
@ -105,6 +105,40 @@ fn in_item_list_after_attr() {
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn in_item_list_after_inner_attr() {
|
||||
check_with_base_items(
|
||||
r#"#![attr] $0"#,
|
||||
expect![[r#"
|
||||
ma makro!(…) macro_rules! makro
|
||||
md module
|
||||
kw async
|
||||
kw const
|
||||
kw crate::
|
||||
kw enum
|
||||
kw extern
|
||||
kw fn
|
||||
kw impl
|
||||
kw impl for
|
||||
kw mod
|
||||
kw pub
|
||||
kw pub(crate)
|
||||
kw pub(super)
|
||||
kw self::
|
||||
kw static
|
||||
kw struct
|
||||
kw trait
|
||||
kw type
|
||||
kw union
|
||||
kw unsafe
|
||||
kw use
|
||||
sn macro_rules
|
||||
sn tfn (Test function)
|
||||
sn tmod (Test module)
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn in_qualified_path() {
|
||||
check_with_base_items(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue