forked from qt-creator/qt-creator
Clang: Don't parse system headers
Change-Id: I6474fbe4f43daaac930ad6ba49fd9cb3145a3bbd Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -74,8 +74,8 @@ private:
|
||||
{
|
||||
clang::index::IndexingOptions options;
|
||||
|
||||
options.SystemSymbolFilter = clang::index::IndexingOptions::SystemSymbolFilterKind::All;
|
||||
options.IndexFunctionLocals = true;
|
||||
options.SystemSymbolFilter = clang::index::IndexingOptions::SystemSymbolFilterKind::None;
|
||||
options.IndexFunctionLocals = false;
|
||||
|
||||
return options;
|
||||
}
|
||||
|
@@ -34,3 +34,8 @@ void f()
|
||||
|
||||
void f(int);
|
||||
void f(double);
|
||||
|
||||
void f2()
|
||||
{
|
||||
function();
|
||||
}
|
||||
|
@@ -97,11 +97,12 @@ TEST_F(SymbolIndexing, Locations)
|
||||
{
|
||||
indexing.indexer().updateProjectParts({projectPart1}, {});
|
||||
|
||||
auto locations = query.locationsAt(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 6, 5);
|
||||
auto locations = query.locationsAt(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 1, 6);
|
||||
ASSERT_THAT(locations,
|
||||
ElementsAre(
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 5, 9),
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 6, 5)));
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 1, 6),
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 3, 6),
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 40, 5)));
|
||||
}
|
||||
|
||||
TEST_F(SymbolIndexing, DISABLED_TemplateFunction)
|
||||
@@ -121,11 +122,12 @@ TEST_F(SymbolIndexing, PathsAreUpdated)
|
||||
|
||||
indexing.indexer().pathsChanged({filePathId(main1Path)});
|
||||
indexing.indexer().pathsChanged({filePathId(main1Path)});
|
||||
auto locations = query.locationsAt(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 6, 5);
|
||||
auto locations = query.locationsAt(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 1, 6);
|
||||
ASSERT_THAT(locations,
|
||||
ElementsAre(
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 5, 9),
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 6, 5)));
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 1, 6),
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 3, 6),
|
||||
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 40, 5)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -168,7 +168,7 @@ TEST_F(SymbolsCollector, CollectSymbolName)
|
||||
collector.collectSymbols();
|
||||
|
||||
ASSERT_THAT(collector.symbols(),
|
||||
Contains(HasSymbolName("x")));
|
||||
Contains(HasSymbolName("function")));
|
||||
}
|
||||
|
||||
TEST_F(SymbolsCollector, SymbolMatchesLocation)
|
||||
|
Reference in New Issue
Block a user