Skip to content

Commit afd6d66

Browse files
committed
[CodeCompletion] Fix attribute completion for var/let decl
There's no attribute declared for PatternBindingDecl. There are for VarDecl. Code completion should consider DeclKind::PatternBinding as DeclKind::Var.
1 parent 896a0b0 commit afd6d66

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4610,6 +4610,8 @@ void CodeCompletionCallbacksImpl::completeDeclAttrKeyword(Decl *D,
46104610
AttTargetDK = DeclKind::Param;
46114611
} else if (D) {
46124612
AttTargetDK = D->getKind();
4613+
if (AttTargetDK == DeclKind::PatternBinding)
4614+
AttTargetDK = DeclKind::Var;
46134615
}
46144616
CurDeclContext = P.CurDeclContext;
46154617
}

0 commit comments

Comments
 (0)