forked from qt-creator/qt-creator
ClangCodeModel: Fix clangd highlighting of string literals
... passed to macros defined in a different file.
This amends e77e57420a. Contrary to our expectation, it is possible that
AST nodes that are marked as belonging (only) to a header file can
contain child nodes that belong to the main file.
Fixes: QTCREATORBUG-26553
Change-Id: I4d1d877d8e1e2dcf7d81b63aa98e1149b5514e3f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -3640,12 +3640,11 @@ void ExtraHighlightingResultsCollector::visitNode(const AstNode &node)
|
||||
if (m_future.isCanceled())
|
||||
return;
|
||||
switch (node.fileStatus(m_filePath)) {
|
||||
case AstNode::FileStatus::Foreign:
|
||||
return;
|
||||
case AstNode::FileStatus::Ours:
|
||||
case AstNode::FileStatus::Unknown:
|
||||
collectFromNode(node);
|
||||
[[fallthrough]];
|
||||
case AstNode::FileStatus::Foreign:
|
||||
case ClangCodeModel::Internal::AstNode::FileStatus::Mixed: {
|
||||
const auto children = node.children();
|
||||
if (!children)
|
||||
|
||||
Reference in New Issue
Block a user