Skip to content

Commit 291e96a

Browse files
committed
fix: pattern completions in let-stmt
1 parent 2fd803c commit 291e96a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/ide-completion/src/context/analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ fn pattern_context_for(
13341334
.map_or((PatternRefutability::Irrefutable, false), |node| {
13351335
let refutability = match_ast! {
13361336
match node {
1337-
ast::LetStmt(let_) => return (PatternRefutability::Irrefutable, let_.ty().is_some()),
1337+
ast::LetStmt(let_) => return (PatternRefutability::Refutable, let_.ty().is_some()),
13381338
ast::Param(param) => {
13391339
let has_type_ascription = param.ty().is_some();
13401340
param_ctx = (|| {

crates/ide-completion/src/tests/pattern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ enum SingleVariantEnum {
146146
}
147147
use SingleVariantEnum::Variant;
148148
fn foo() {
149-
let a$0
149+
for a$0
150150
}
151151
"#,
152152
expect![[r#"

0 commit comments

Comments
 (0)