| 99 | } |
| 100 | |
| 101 | void SourceCodeInsertion::setSubScope(const QualifiedIdentifier& scope) |
| 102 | { |
| 103 | m_scope = scope; |
| 104 | |
| 105 | if (!m_context) { |
| 106 | return; |
| 107 | } |
| 108 | |
| 109 | QStringList needNamespace = m_scope.toStringList(); |
| 110 | |
| 111 | bool foundChild = true; |
| 112 | while (!needNamespace.isEmpty() && foundChild) { |
| 113 | foundChild = false; |
| 114 | |
| 115 | const auto childContexts = m_context->childContexts(); |
| 116 | for (DUContext* child : childContexts) { |
| 117 | clangDebug() << "checking child" << child->localScopeIdentifier().toString() << "against" |
| 118 | << needNamespace.first(); |
| 119 | if (child->localScopeIdentifier().toString() == needNamespace.first() && child->type() == DUContext::Namespace) { |
| 120 | clangDebug() << "taking"; |
| 121 | m_context = child; |
| 122 | foundChild = true; |
| 123 | needNamespace.pop_front(); |
| 124 | break; |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | m_scope = stripPrefixes(m_context, QualifiedIdentifier(needNamespace.join(QLatin1String("::")))); |
| 130 | } |
| 131 | |
| 132 | QString SourceCodeInsertion::applySubScope(const QString& decl) const |
| 133 | { |
no test coverage detected