Clang: Use built-in follow symbol for "ui_*" includes

Currently ClangCodeModel will follow to the temporary
empty generated file instead of the proper "ui_*" header.
Use built-in follow symbol for such includes until we fix
the initial issue that requires these empty files.

Task-number: QTCREATORBUG-20579
Change-Id: If67d21ea7b44889c93d3d41193403bade2dc330a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-06-19 12:43:23 +02:00
parent bc02c97369
commit f112edd905

View File

@@ -142,7 +142,12 @@ FollowSymbolResult FollowSymbol::followSymbol(CXTranslationUnit tu,
CXFile file = clang_getIncludedFile(cursors[tokenIndex]); CXFile file = clang_getIncludedFile(cursors[tokenIndex]);
const ClangString filename(clang_getFileName(file)); const ClangString filename(clang_getFileName(file));
const SourceLocation loc(tu, filename, 1, 1); const SourceLocation loc(tu, filename, 1, 1);
return SourceRangeContainer(SourceRange(loc, loc)); FollowSymbolResult result;
result.range = SourceRangeContainer(SourceRange(loc, loc));
// CLANG-UPGRADE-CHECK: Remove if we don't use empty generated ui_* headers anymore.
if (Utf8String(filename).contains("ui_"))
result.isResultOnlyForFallBack = true;
return result;
} }
// For definitions we can always find a declaration in current TU // For definitions we can always find a declaration in current TU