mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
fix: Don't trigger pattern completions when typing a wildcard pattern
This commit is contained in:
parent
6e9c963348
commit
1f028403cd
@ -489,7 +489,11 @@ pub(super) fn complete_name(
|
|||||||
NameKind::Function => {
|
NameKind::Function => {
|
||||||
item_list::trait_impl::complete_trait_impl_fn(acc, ctx, name);
|
item_list::trait_impl::complete_trait_impl_fn(acc, ctx, name);
|
||||||
}
|
}
|
||||||
NameKind::IdentPat(pattern_ctx) => complete_patterns(acc, ctx, pattern_ctx),
|
NameKind::IdentPat(pattern_ctx) => {
|
||||||
|
if ctx.token.kind() != syntax::T![_] {
|
||||||
|
complete_patterns(acc, ctx, pattern_ctx)
|
||||||
|
}
|
||||||
|
}
|
||||||
NameKind::Module(mod_under_caret) => {
|
NameKind::Module(mod_under_caret) => {
|
||||||
mod_::complete_mod(acc, ctx, mod_under_caret);
|
mod_::complete_mod(acc, ctx, mod_under_caret);
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,18 @@ fn check(ra_fixture: &str, expect: Expect) {
|
|||||||
expect.assert_eq(&actual)
|
expect.assert_eq(&actual)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn wildcard() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
fn quux() {
|
||||||
|
let _$0
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
expect![""],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ident_rebind_pat() {
|
fn ident_rebind_pat() {
|
||||||
check_empty(
|
check_empty(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user