Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 941ddfd9 authored by Sergey Kalinichev's avatar Sergey Kalinichev

Move currentClassContext initialization out of the for loop

parent c2add5c4
......@@ -857,6 +857,9 @@ QList<CompletionTreeItemPointer> ClangCodeCompletionContext::completionItems(boo
LookAheadItemMatcher lookAheadMatcher(TopDUContextPointer(ctx->topContext()));
// If ctx is/inside the Class context, this represents that context.
const auto currentClassContext = classDeclarationForContext(ctx, m_position);
clangDebug() << "Clang found" << m_results->NumResults << "completion results";
for (uint i = 0; i < m_results->NumResults; ++i) {
......@@ -886,8 +889,6 @@ QList<CompletionTreeItemPointer> ClangCodeCompletionContext::completionItems(boo
continue;
}
// If ctx is/inside the Class context, this represents that context.
auto currentClassContext = classDeclarationForContext(ctx, m_position);
if (availability == CXAvailability_NotAccessible && (!isDeclaration || !currentClassContext)) {
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment