* Return a list of header files viable for inclusions. All elements will be unique */
| 387 | * Return a list of header files viable for inclusions. All elements will be unique |
| 388 | */ |
| 389 | QStringList includeFiles(const QualifiedIdentifier& identifier, const QVector<Declaration*>& declarations, const KDevelop::Path& file) |
| 390 | { |
| 391 | const auto includes = includePaths( file ); |
| 392 | if( includes.isEmpty() ) { |
| 393 | clangDebug() << "Include path is empty"; |
| 394 | return {}; |
| 395 | } |
| 396 | |
| 397 | const auto candidates = UnknownDeclarationProblem::findMatchingIncludeFiles(declarations); |
| 398 | if( !candidates.isEmpty() ) { |
| 399 | // If we find a candidate from the duchain we don't bother scanning the include paths |
| 400 | return candidates; |
| 401 | } |
| 402 | |
| 403 | return scanIncludePaths(identifier, includes); |
| 404 | } |
| 405 | |
| 406 | /** |
| 407 | * Construct viable forward declarations for the type name. |
no test coverage detected