forked from qt-creator/qt-creator
Clang: Fix canceling of clang query
Every AST unit is created and queried asynchronously, like before, but we don't wait anymore but use a timer to process new sources. So the server will not be blocked and can process other messages like cancel. Change-Id: If0e69466c78f628190f59fd32a03cab1c3a4d0a3 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -89,6 +89,20 @@ TEST_F(ClangQuerySlowTest, SourceRangeInUnsavedFileDeclarationRange)
|
||||
IsSourceRangeWithText(1, 1, 1, 15, "void unsaved();"));
|
||||
}
|
||||
|
||||
TEST_F(ClangQuerySlowTest, DISABLED_SourceRangeInUnsavedFileDeclarationRangeOverride) // seems not to work in Clang
|
||||
{
|
||||
::ClangQuery query;
|
||||
query.addFile(TESTDATA_DIR, "query_simplefunction.cpp", "void f() {}", {"cc", "query_simplefunction.cpp", "-std=c++14"});
|
||||
query.setQuery("functionDecl()");
|
||||
ClangBackEnd::V2::FileContainer unsavedFile{{TESTDATA_DIR, "query_simplefunction.cpp"}, "void unsaved();", {}};
|
||||
query.addUnsavedFiles({unsavedFile});
|
||||
|
||||
query.findLocations();
|
||||
|
||||
ASSERT_THAT(query.takeSourceRanges().sourceRangeWithTextContainers().at(0),
|
||||
IsSourceRangeWithText(1, 1, 1, 15, "void unsaved();"));
|
||||
}
|
||||
|
||||
TEST_F(ClangQuerySlowTest, RootSourceRangeForSimpleFieldDeclarationRange)
|
||||
{
|
||||
simpleClassQuery.setQuery("fieldDecl(hasType(isInteger()))");
|
||||
|
||||
Reference in New Issue
Block a user