mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-24 08:35:08 +00:00
Namespace: improve indexer and don't trace bases in $ccls/member
This commit is contained in:
parent
ac2d921ab9
commit
c5ae521d36
@ -734,8 +734,17 @@ public:
|
|||||||
|
|
||||||
// spell, extent, comments use OrigD while most others use adjusted |D|.
|
// spell, extent, comments use OrigD while most others use adjusted |D|.
|
||||||
const Decl *OrigD = ASTNode.OrigD;
|
const Decl *OrigD = ASTNode.OrigD;
|
||||||
const DeclContext *SemDC = OrigD->getDeclContext();
|
const DeclContext *SemDC = OrigD->getDeclContext()->getRedeclContext();
|
||||||
const DeclContext *LexDC = ASTNode.ContainerDC;
|
const DeclContext *LexDC = ASTNode.ContainerDC->getRedeclContext();
|
||||||
|
{
|
||||||
|
const NamespaceDecl *ND;
|
||||||
|
while ((ND = dyn_cast<NamespaceDecl>(cast<Decl>(SemDC))) &&
|
||||||
|
ND->isAnonymousNamespace())
|
||||||
|
SemDC = ND->getDeclContext()->getRedeclContext();
|
||||||
|
while ((ND = dyn_cast<NamespaceDecl>(cast<Decl>(LexDC))) &&
|
||||||
|
ND->isAnonymousNamespace())
|
||||||
|
LexDC = ND->getDeclContext()->getRedeclContext();
|
||||||
|
}
|
||||||
Role role = static_cast<Role>(Roles);
|
Role role = static_cast<Role>(Roles);
|
||||||
db->language = LanguageId((int)db->language | (int)GetDeclLanguage(D));
|
db->language = LanguageId((int)db->language | (int)GetDeclLanguage(D));
|
||||||
|
|
||||||
|
@ -145,7 +145,9 @@ bool Expand(MessageHandler *m, Out_CclsMember::Entry *entry,
|
|||||||
type = stack.back();
|
type = stack.back();
|
||||||
stack.pop_back();
|
stack.pop_back();
|
||||||
const auto *def = type->AnyDef();
|
const auto *def = type->AnyDef();
|
||||||
if (!def) continue;
|
if (!def)
|
||||||
|
continue;
|
||||||
|
if (def->kind != lsSymbolKind::Namespace)
|
||||||
for (Usr usr : def->bases) {
|
for (Usr usr : def->bases) {
|
||||||
auto &type1 = m->db->Type(usr);
|
auto &type1 = m->db->Type(usr);
|
||||||
if (type1.def.size()) {
|
if (type1.def.size()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user