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

Method waitForUpdate

kdevplatform/language/duchain/duchain.cpp:1830–1855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1828}
1829
1830KDevelop::ReferencedTopDUContext DUChain::waitForUpdate(const KDevelop::IndexedString& document,
1831 KDevelop::TopDUContext::Features minFeatures, bool proxyContext)
1832{
1833 Q_ASSERT(!lock()->currentThreadHasReadLock() && !lock()->currentThreadHasWriteLock());
1834
1835 WaitForUpdate waiter;
1836 updateContextForUrl(document, minFeatures, &waiter);
1837
1838 while (!waiter.m_ready) {
1839 // we might have been shut down in the meanwhile
1840 if (!ICore::self()) {
1841 return nullptr;
1842 }
1843
1844 QMetaObject::invokeMethod(ICore::self()->languageController()->backgroundParser(), "parseDocuments");
1845 QCoreApplication::processEvents();
1846 QThread::usleep(1000);
1847 }
1848
1849 if (!proxyContext) {
1850 DUChainReadLocker readLock(DUChain::lock());
1851 return DUChainUtils::contentContextFromProxyContext(waiter.m_topContext);
1852 }
1853
1854 return waiter.m_topContext;
1855}
1856
1857void DUChain::updateContextForUrl(const IndexedString& document, TopDUContext::Features minFeatures,
1858 QObject* notifyReady, int priority) const

Callers 9

parseMethod · 0.80
testFilesMethod · 0.80
changeDocumentMethod · 0.80
openDocumentMethod · 0.80
defaultMethodsMethod · 0.80
executeMethod · 0.80
moveIntoSourceMethod · 0.80
parseAndCheckMethod · 0.80

Calls 4

backgroundParserMethod · 0.80
languageControllerMethod · 0.80

Tested by 5

parseMethod · 0.64
testFilesMethod · 0.64
changeDocumentMethod · 0.64
openDocumentMethod · 0.64
parseAndCheckMethod · 0.64