Add doc(alias)-based function name completion

This commit is contained in:
hecatia-elegua 2023-04-05 19:35:21 +02:00
parent 410acd7188
commit f87f468dbd
2 changed files with 47 additions and 0 deletions

View file

@ -147,6 +147,8 @@ fn render(
}
}
}
item.doc_aliases(ctx.doc_aliases);
item
}

View file

@ -1105,3 +1105,48 @@ fn here_we_go() {
"#]],
);
}
#[test]
fn completes_fn_name_via_doc_alias_in_fn_body() {
check(
r#"
#[doc(alias = "qux")]
fn foo() {}
fn bar() { qu$0 }
"#,
expect![[r#"
fn bar() fn()
fn foo() (alias qux) fn()
bt u32
kw const
kw crate::
kw enum
kw extern
kw false
kw fn
kw for
kw if
kw if let
kw impl
kw let
kw loop
kw match
kw mod
kw return
kw self::
kw static
kw struct
kw trait
kw true
kw type
kw union
kw unsafe
kw use
kw while
kw while let
sn macro_rules
sn pd
sn ppd
"#]],
);
}