forked from qt-creator/qt-creator
Clang: Locator filter for the symbol database
There are no symbol queries for the locator filters. The signature generation is still not implemented but for simple cases it should work. Change-Id: Ic6b04fbe1e7e057892f194ac139615c47d6ec33f Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -47,16 +47,16 @@ Utils::SmallString symbolName(const clang::NamedDecl *declaration)
|
||||
return declarationName.getAsString();
|
||||
}
|
||||
|
||||
SymbolType symbolType(clang::index::SymbolRoleSet roles)
|
||||
SourceLocationKind sourceLocationKind(clang::index::SymbolRoleSet roles)
|
||||
{
|
||||
if (hasSymbolRole(clang::index::SymbolRole::Reference, roles))
|
||||
return SymbolType::DeclarationReference;
|
||||
return SourceLocationKind::DeclarationReference;
|
||||
else if (hasSymbolRole(clang::index::SymbolRole::Declaration, roles))
|
||||
return SymbolType::Declaration;
|
||||
return SourceLocationKind::Declaration;
|
||||
else if (hasSymbolRole(clang::index::SymbolRole::Definition, roles))
|
||||
return SymbolType::Definition;
|
||||
return SourceLocationKind::Definition;
|
||||
|
||||
return SymbolType::None;
|
||||
return SourceLocationKind::None;
|
||||
}
|
||||
|
||||
using SymbolKindAndTags = std::pair<SymbolKind, SymbolTags>;
|
||||
@@ -133,7 +133,7 @@ bool IndexDataConsumer::handleDeclOccurence(const clang::Decl *declaration,
|
||||
m_sourceLocationEntries.emplace_back(globalId,
|
||||
filePathId(sourceLocation),
|
||||
lineColum(sourceLocation),
|
||||
symbolType(symbolRoles));
|
||||
sourceLocationKind(symbolRoles));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user