Skip to content

Commit 18c71ac

Browse files
chouzzDimitri Ratz
authored andcommitted
Fix access for class method
1 parent 103b18f commit 18c71ac

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

clang-tools-extra/clangd/FindSymbols.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ std::vector<SymbolTag> getSymbolTags(const NamedDecl &ND)
197197
Tags.push_back(SymbolTag::Constant);
198198
if (isStatic(&ND))
199199
Tags.push_back(SymbolTag::Static);
200+
if (isVirtual(&ND))
201+
Tags.push_back(SymbolTag::Virtual);
202+
200203
if (const FieldDecl *FD = dyn_cast<FieldDecl>(&ND)) {
201204
switch (FD->getAccess()) {
202205
case AS_public:
@@ -212,8 +215,7 @@ std::vector<SymbolTag> getSymbolTags(const NamedDecl &ND)
212215
break;
213216
}
214217
}
215-
if (isVirtual(&ND))
216-
Tags.push_back(SymbolTag::Virtual);
218+
217219
return Tags;
218220
}
219221

clang-tools-extra/clangd/Protocol.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,8 @@ llvm::json::Value toJSON(const DocumentSymbol &S) {
964964
Result["children"] = S.children;
965965
if (S.deprecated)
966966
Result["deprecated"] = true;
967+
if (!S.tags.empty())
968+
Result["tags"] = S.tags;
967969
// FIXME: workaround for older gcc/clang
968970
return std::move(Result);
969971
}

clang-tools-extra/clangd/SemanticHighlighting.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "SemanticHighlighting.h"
10+
#include "AST.h"
1011
#include "Config.h"
1112
#include "FindTarget.h"
1213
#include "ParsedAST.h"

0 commit comments

Comments
 (0)