File tree Expand file tree Collapse file tree 3 files changed +33
-28
lines changed Expand file tree Collapse file tree 3 files changed +33
-28
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,8 @@ bool isConst(const Decl *D) {
228228 if (CMD->isConst ())
229229 return true ;
230230 }
231+ if (const auto *FD = llvm::dyn_cast<FunctionDecl>(D))
232+ return isConst (FD->getReturnType ());
231233 return false ;
232234}
233235
@@ -240,6 +242,8 @@ bool isStatic(const Decl *D) {
240242 return OPD->isClassProperty ();
241243 if (const auto *OMD = llvm::dyn_cast<ObjCMethodDecl>(D))
242244 return OMD->isClassMethod ();
245+ if (const auto *FD = llvm::dyn_cast<FunctionDecl>(D))
246+ return FD->isStatic ();
243247 return false ;
244248}
245249
Original file line number Diff line number Diff line change @@ -193,29 +193,31 @@ std::vector<SymbolTag> getSymbolTags(const NamedDecl &ND) {
193193 if (ND.isDeprecated ())
194194 Tags.push_back (SymbolTag::Deprecated);
195195 if (isConst (&ND))
196- Tags.push_back (SymbolTag::Constant );
196+ Tags.push_back (SymbolTag::ReadOnly );
197197 if (isStatic (&ND))
198198 Tags.push_back (SymbolTag::Static);
199199 if (isVirtual (&ND))
200200 Tags.push_back (SymbolTag::Virtual);
201- if (!isa<UnresolvedUsingValueDecl>(ND))
202- Tags.push_back (SymbolTag::Declaration);
201+ if (isAbstract (&ND))
202+ Tags.push_back (SymbolTag::Abstract);
203+
203204 if (isUniqueDefinition (&ND))
204205 Tags.push_back (SymbolTag::Definition);
205- if (const FieldDecl *FD = dyn_cast<FieldDecl>(&ND)) {
206- switch (FD->getAccess ()) {
207- case AS_public:
208- Tags.push_back (SymbolTag::Public);
209- break ;
210- case AS_protected:
211- Tags.push_back (SymbolTag::Protected);
212- break ;
213- case AS_private:
214- Tags.push_back (SymbolTag::Private);
215- break ;
216- default :
217- break ;
218- }
206+ else if (!isa<UnresolvedUsingValueDecl>(ND))
207+ Tags.push_back (SymbolTag::Declaration);
208+
209+ switch (ND.getAccess ()) {
210+ case AS_public:
211+ Tags.push_back (SymbolTag::Public);
212+ break ;
213+ case AS_protected:
214+ Tags.push_back (SymbolTag::Protected);
215+ break ;
216+ case AS_private:
217+ Tags.push_back (SymbolTag::Private);
218+ break ;
219+ default :
220+ break ;
219221 }
220222
221223 return Tags;
Original file line number Diff line number Diff line change @@ -1105,7 +1105,7 @@ struct CodeAction {
11051105llvm::json::Value toJSON (const CodeAction &);
11061106
11071107enum class SymbolTag {
1108- Deprecated = 1 ,
1108+ Deprecated = 1 ,
11091109 Private = 2 ,
11101110 Package = 3 ,
11111111 Protected = 4 ,
@@ -1116,16 +1116,15 @@ enum class SymbolTag {
11161116 Abstract = 9 ,
11171117 Final = 10 ,
11181118 Sealed = 11 ,
1119- Constant = 12 ,
1120- Transient = 13 ,
1121- Volatile = 14 ,
1122- Synchronized = 15 ,
1123- Virtual = 16 ,
1124- Nullable = 17 ,
1125- NonNull = 18 ,
1126- Declaration = 19 ,
1127- Definition = 20 ,
1128- ReadOnly = 21 ,
1119+ Transient = 12 ,
1120+ Volatile = 13 ,
1121+ Synchronized = 14 ,
1122+ Virtual = 15 ,
1123+ Nullable = 16 ,
1124+ NonNull = 17 ,
1125+ Declaration = 18 ,
1126+ Definition = 19 ,
1127+ ReadOnly = 20 ,
11291128};
11301129llvm::json::Value toJSON (SymbolTag);
11311130// / Represents programming constructs like variables, classes, interfaces etc.
You can’t perform that action at this time.
0 commit comments