File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ bool isConst(const Decl *D) {
203203 if (CMD->isConst ())
204204 return true ;
205205 }
206+ if (const auto *FD = llvm::dyn_cast<FunctionDecl>(D))
207+ return isConst (FD->getReturnType ());
206208 return false ;
207209}
208210
@@ -215,6 +217,8 @@ bool isStatic(const Decl *D) {
215217 return OPD->isClassProperty ();
216218 if (const auto *OMD = llvm::dyn_cast<ObjCMethodDecl>(D))
217219 return OMD->isClassMethod ();
220+ if (const auto *FD = llvm::dyn_cast<FunctionDecl>(D))
221+ return FD->isStatic ();
218222 return false ;
219223}
220224
Original file line number Diff line number Diff line change @@ -192,29 +192,31 @@ std::vector<SymbolTag> getSymbolTags(const NamedDecl &ND) {
192192 if (ND.isDeprecated ())
193193 Tags.push_back (SymbolTag::Deprecated);
194194 if (isConst (&ND))
195- Tags.push_back (SymbolTag::Constant );
195+ Tags.push_back (SymbolTag::ReadOnly );
196196 if (isStatic (&ND))
197197 Tags.push_back (SymbolTag::Static);
198198 if (isVirtual (&ND))
199199 Tags.push_back (SymbolTag::Virtual);
200- if (!isa<UnresolvedUsingValueDecl>(ND))
201- Tags.push_back (SymbolTag::Declaration);
200+ if (isAbstract (&ND))
201+ Tags.push_back (SymbolTag::Abstract);
202+
202203 if (isUniqueDefinition (&ND))
203204 Tags.push_back (SymbolTag::Definition);
204- if (const FieldDecl *FD = dyn_cast<FieldDecl>(&ND)) {
205- switch (FD->getAccess ()) {
206- case AS_public:
207- Tags.push_back (SymbolTag::Public);
208- break ;
209- case AS_protected:
210- Tags.push_back (SymbolTag::Protected);
211- break ;
212- case AS_private:
213- Tags.push_back (SymbolTag::Private);
214- break ;
215- default :
216- break ;
217- }
205+ else if (!isa<UnresolvedUsingValueDecl>(ND))
206+ Tags.push_back (SymbolTag::Declaration);
207+
208+ switch (ND.getAccess ()) {
209+ case AS_public:
210+ Tags.push_back (SymbolTag::Public);
211+ break ;
212+ case AS_protected:
213+ Tags.push_back (SymbolTag::Protected);
214+ break ;
215+ case AS_private:
216+ Tags.push_back (SymbolTag::Private);
217+ break ;
218+ default :
219+ break ;
218220 }
219221
220222 return Tags;
Original file line number Diff line number Diff line change @@ -1091,7 +1091,7 @@ struct CodeAction {
10911091llvm::json::Value toJSON (const CodeAction &);
10921092
10931093enum class SymbolTag {
1094- Deprecated = 1 ,
1094+ Deprecated = 1 ,
10951095 Private = 2 ,
10961096 Package = 3 ,
10971097 Protected = 4 ,
@@ -1102,16 +1102,15 @@ enum class SymbolTag {
11021102 Abstract = 9 ,
11031103 Final = 10 ,
11041104 Sealed = 11 ,
1105- Constant = 12 ,
1106- Transient = 13 ,
1107- Volatile = 14 ,
1108- Synchronized = 15 ,
1109- Virtual = 16 ,
1110- Nullable = 17 ,
1111- NonNull = 18 ,
1112- Declaration = 19 ,
1113- Definition = 20 ,
1114- ReadOnly = 21 ,
1105+ Transient = 12 ,
1106+ Volatile = 13 ,
1107+ Synchronized = 14 ,
1108+ Virtual = 15 ,
1109+ Nullable = 16 ,
1110+ NonNull = 17 ,
1111+ Declaration = 18 ,
1112+ Definition = 19 ,
1113+ ReadOnly = 20 ,
11151114};
11161115llvm::json::Value toJSON (SymbolTag);
11171116// / Represents programming constructs like variables, classes, interfaces etc.
You can’t perform that action at this time.
0 commit comments