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

Method documentLoaded

kdevplatform/language/backgroundparser/backgroundparser.cpp:973–1001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

971}
972
973void BackgroundParser::documentLoaded(IDocument* document)
974{
975 Q_D(BackgroundParser);
976
977 QMutexLocker l(&d->m_mutex);
978 if (document->textDocument() && document->textDocument()->url().isValid()) {
979 KTextEditor::Document* textDocument = document->textDocument();
980
981 IndexedString url(document->url());
982 // Some debugging because we had issues with this
983
984 QMutexLocker l2(&d->m_managedMutex);
985 auto urlIt = d->m_managed.find(url);
986 if (urlIt != d->m_managed.end() && (*urlIt)->document() == textDocument) {
987 qCDebug(LANGUAGE) << "Got redundant documentLoaded from" << document->url() << textDocument;
988 return;
989 }
990
991 qCDebug(LANGUAGE) << "Creating change tracker for " << document->url();
992
993 Q_ASSERT(!d->m_managed.contains(url));
994 Q_ASSERT(!d->m_managedTextDocumentUrls.contains(textDocument));
995
996 d->m_managedTextDocumentUrls[textDocument] = url;
997 d->m_managed.insert(url, new DocumentChangeTracker(textDocument));
998 } else {
999 qCDebug(LANGUAGE) << "NOT creating change tracker for" << document->url();
1000 }
1001}
1002
1003void BackgroundParser::documentUrlChanged(IDocument* document)
1004{

Callers

nothing calls this directly

Calls 8

textDocumentMethod · 0.45
isValidMethod · 0.45
urlMethod · 0.45
findMethod · 0.45
endMethod · 0.45
documentMethod · 0.45
containsMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected