| 230 | } |
| 231 | |
| 232 | TopDUContext* DUChainUtils::contentContextFromProxyContext(TopDUContext* top) |
| 233 | { |
| 234 | if(!top) |
| 235 | return nullptr; |
| 236 | if(top->parsingEnvironmentFile() && top->parsingEnvironmentFile()->isProxyContext()) { |
| 237 | if(!top->importedParentContexts().isEmpty()) |
| 238 | { |
| 239 | DUContext* ctx = top->importedParentContexts().at(0).context(nullptr); |
| 240 | if(!ctx) |
| 241 | return nullptr; |
| 242 | TopDUContext* ret = ctx->topContext(); |
| 243 | if(!ret) |
| 244 | return nullptr; |
| 245 | if(ret->url() != top->url()) |
| 246 | qCDebug(LANGUAGE) << "url-mismatch between content and proxy:" << top->url().toUrl() << ret->url().toUrl(); |
| 247 | if(ret->url() == top->url() && !ret->parsingEnvironmentFile()->isProxyContext()) |
| 248 | return ret; |
| 249 | } |
| 250 | else { |
| 251 | qCDebug(LANGUAGE) << "Proxy-context imports no content-context"; |
| 252 | } |
| 253 | } else |
| 254 | return top; |
| 255 | return nullptr; |
| 256 | } |
| 257 | |
| 258 | TopDUContext* DUChainUtils::standardContextForUrl(const QUrl& url, bool preferProxyContext) { |
| 259 | KDevelop::TopDUContext* chosen = nullptr; |
nothing calls this directly
no test coverage detected