CppEditor: Remove using namespace quickfix: Don't insert inline namespaces

Change-Id: If386d31de723ca928d3c50f55e32205c50937b0a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Leander Schulten
2020-11-18 21:53:51 +01:00
parent bb9ca6227c
commit 993b614d94
4 changed files with 70 additions and 11 deletions

View File

@@ -7538,7 +7538,9 @@ private:
const QList<LookupItem> localLookup = m_context.lookup(ast->name->name, scope);
QList<const Name *> longestName;
for (const LookupItem &item : localLookup) {
QList<const Name *> names = m_context.fullyQualifiedName(item.declaration());
QList<const Name *> names
= m_context.fullyQualifiedName(item.declaration(),
LookupContext::HideInlineNamespaces);
if (names.length() > longestName.length())
longestName = names;
}
@@ -7574,8 +7576,9 @@ private:
const QList<LookupItem> lookups = m_context.lookup(wantToLookup, scope);
if (!lookups.empty()) {
QList<const Name *> fullName = m_context.fullyQualifiedName(
lookups.first().declaration());
QList<const Name *> fullName
= m_context.fullyQualifiedName(lookups.first().declaration(),
LookupContext::HideInlineNamespaces);
const int currentNameCount = countNames(wantToLookup);
const bool needNamespace = needMissingNamespaces(std::move(fullName),
currentNameCount);