| 256 | } |
| 257 | |
| 258 | TopDUContext* DUChainUtils::standardContextForUrl(const QUrl& url, bool preferProxyContext) { |
| 259 | KDevelop::TopDUContext* chosen = nullptr; |
| 260 | |
| 261 | const auto languages = ICore::self()->languageController()->languagesForUrl(url); |
| 262 | |
| 263 | for (const auto language : languages) { |
| 264 | if(!chosen) |
| 265 | { |
| 266 | chosen = language->standardContext(url, preferProxyContext); |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | if(!chosen) |
| 271 | chosen = DUChain::self()->chainForDocument(IndexedString(url), preferProxyContext); |
| 272 | |
| 273 | if(!chosen && preferProxyContext) |
| 274 | return standardContextForUrl(url, false); // Fall back to a normal context |
| 275 | |
| 276 | return chosen; |
| 277 | } |
| 278 | |
| 279 | struct ItemUnderCursorInternal |
| 280 | { |
nothing calls this directly
no test coverage detected