forked from qt-creator/qt-creator
clangbackend: Fix highlighting for #include directives
These were falsely categorized as string literals. No one ever noticed,
because highlighting information for string literals was ignored until
baf25e4cdb.
Change-Id: Ib59fde04359aecb6da3995de1a9febbbf41b12c8
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -928,7 +928,8 @@ TEST_F(TokenProcessor, PreprocessorInclusionDirective)
|
||||
{
|
||||
const auto infos = translationUnit.tokenInfosInRange(sourceRange(239, 18));
|
||||
|
||||
ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::StringLiteral));
|
||||
ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor));
|
||||
ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::StringLiteral));
|
||||
}
|
||||
|
||||
TEST_F(TokenProcessor, GotoLabelStatement)
|
||||
@@ -1080,6 +1081,7 @@ TEST_F(TokenProcessor, PreprocessorInclusionDirectiveWithAngleBrackets )
|
||||
{
|
||||
const auto infos = translationUnit.tokenInfosInRange(sourceRange(289, 38));
|
||||
|
||||
ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor));
|
||||
ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::StringLiteral));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user