Skip to content

Commit 3955f5e

Browse files
committed
Don't code-complete any ValueDecl that's not user accessible.
1 parent c25210f commit 3955f5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ static bool shouldHideDeclFromCompletionResults(const ValueDecl *D) {
303303
if (D->getName().isEditorPlaceholder())
304304
return true;
305305

306+
if (!D->isUserAccessible())
307+
return true;
308+
306309
return false;
307310
}
308311

@@ -2048,7 +2051,6 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
20482051

20492052
void addVarDeclRef(const VarDecl *VD, DeclVisibilityKind Reason) {
20502053
if (!VD->hasName() ||
2051-
!VD->isUserAccessible() ||
20522054
(VD->hasAccessibility() && !VD->isAccessibleFrom(CurrDeclContext)) ||
20532055
shouldHideDeclFromCompletionResults(VD))
20542056
return;

0 commit comments

Comments
 (0)