diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-06-19 12:43:23 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-06-20 08:10:51 +0000 |
commit | f112edd905598b0559d6edd06885d08588ba7348 (patch) | |
tree | 58b4f087a6f2c40bb4850874dd21a8cc394ba368 /src/tools/clangbackend/source/clangfollowsymbol.cpp | |
parent | bc02c97369ff944a38375887de5ce72c912f962f (diff) | |
download | qt-creator-f112edd905598b0559d6edd06885d08588ba7348.tar.gz |
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>
Diffstat (limited to 'src/tools/clangbackend/source/clangfollowsymbol.cpp')
-rw-r--r-- | src/tools/clangbackend/source/clangfollowsymbol.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/clangbackend/source/clangfollowsymbol.cpp b/src/tools/clangbackend/source/clangfollowsymbol.cpp index d41af5dc75..2dcdca4bef 100644 --- a/src/tools/clangbackend/source/clangfollowsymbol.cpp +++ b/src/tools/clangbackend/source/clangfollowsymbol.cpp @@ -142,7 +142,12 @@ FollowSymbolResult FollowSymbol::followSymbol(CXTranslationUnit tu, CXFile file = clang_getIncludedFile(cursors[tokenIndex]); const ClangString filename(clang_getFileName(file)); 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 |