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

Method encounterGlobalDeclaration

plugins/qmljs/duchain/expressionvisitor.cpp:356–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356bool ExpressionVisitor::encounterGlobalDeclaration(const QualifiedIdentifier& id)
357{
358 bool ret = false;
359 // Use the persistent symbol table to find this declaration, even if it is in another file
360 // Explore the declarations and filter-out those that come from a file outside the current directory
361 PersistentSymbolTable::self().visitDeclarations(
362 IndexedQualifiedIdentifier(id), [&](const IndexedDeclaration& decl) {
363 if (!m_currentDir.isValid()) {
364 m_currentDir = Path(m_context->topContext()->url().str()).parent();
365 }
366
367 IndexedTopDUContext declTopContext = decl.indexedTopContext();
368
369 if (!declTopContext.isValid()) {
370 return PersistentSymbolTable::VisitorState::Continue;
371 }
372
373 if (m_currentDir.isDirectParentOf(Path(declTopContext.url().str()))) {
374 encounterLvalue(DeclarationPointer(decl.declaration()));
375 ret = true;
376 return PersistentSymbolTable::VisitorState::Break;
377 }
378 return PersistentSymbolTable::VisitorState::Continue;
379 });
380
381 return ret;
382}
383
384void ExpressionVisitor::encounterFieldMember(const QString& name)
385{

Callers

nothing calls this directly

Calls 11

visitDeclarationsMethod · 0.80
strMethod · 0.80
isDirectParentOfMethod · 0.80
PathClass · 0.50
isValidMethod · 0.45
parentMethod · 0.45
urlMethod · 0.45
topContextMethod · 0.45
indexedTopContextMethod · 0.45
declarationMethod · 0.45

Tested by

no test coverage detected