MCPcopy Create free account
hub / github.com/KDE/kdevelop / standardContextForUrl

Method standardContextForUrl

kdevplatform/language/duchain/duchainutils.cpp:258–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258TopDUContext* 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
279struct ItemUnderCursorInternal
280{

Callers

nothing calls this directly

Calls 5

languagesForUrlMethod · 0.80
languageControllerMethod · 0.80
chainForDocumentMethod · 0.80
IndexedStringClass · 0.70
standardContextMethod · 0.45

Tested by

no test coverage detected