mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix: Don't add braces to 'if' completion in match guard position
When the cursor is in a match arm, but before the fat arrow (=>) token, don't add braces when autocompleting "if". fixes #12823
This commit is contained in:
parent
0b131bc78e
commit
13c83f90ac
4 changed files with 88 additions and 1 deletions
|
@ -138,6 +138,9 @@ pub(crate) struct ExprCtx {
|
|||
pub(crate) self_param: Option<hir::SelfParam>,
|
||||
pub(crate) innermost_ret_ty: Option<hir::Type>,
|
||||
pub(crate) impl_: Option<ast::Impl>,
|
||||
/// Whether this expression occurs in match arm guard position: before the
|
||||
/// fat arrow token
|
||||
pub(crate) in_match_guard: bool,
|
||||
}
|
||||
|
||||
/// Original file ast nodes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue