forked from qt-creator/qt-creator
Clang: Remove extern and static declarations from symbol outline...
... in case they appear within the function body. Task-number: QTCREATORBUG-20434 Change-Id: I6d12ab857cca5fe8479ac3fb426329ae7d732567 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -80,6 +80,17 @@ void buildTree(const TokenContainers &containers,
|
||||
if (lexicalParentIndex >= 0 && treeItemCache[lexicalParentIndex])
|
||||
parent = treeItemCache[lexicalParentIndex];
|
||||
|
||||
if (parent != root
|
||||
&& (container.extraInfo.storageClass == ClangBackEnd::StorageClass::Extern
|
||||
|| container.extraInfo.storageClass == ClangBackEnd::StorageClass::Static)) {
|
||||
ClangBackEnd::HighlightingType parentType = parent->token.types.mainHighlightingType;
|
||||
if (parentType == ClangBackEnd::HighlightingType::VirtualFunction
|
||||
|| parentType == ClangBackEnd::HighlightingType::Function) {
|
||||
// Treat static and extern variables inside a function scope as local variables.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
parent->appendChild(item.release());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user