| 354 | } |
| 355 | |
| 356 | bool 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 | |
| 384 | void ExpressionVisitor::encounterFieldMember(const QString& name) |
| 385 | { |
nothing calls this directly
no test coverage detected