mirror of
				https://github.com/MaskRay/ccls.git
				synced 2025-10-31 20:53:01 +00:00 
			
		
		
		
	Add mnemonic constants to ClangSymbolKind
This commit is contained in:
		
							parent
							
								
									d49679d885
								
							
						
					
					
						commit
						4e6c585e59
					
				| @ -77,17 +77,17 @@ using IndexVarId = Id<IndexVar>; | |||||||
| 
 | 
 | ||||||
| struct IdCache; | struct IdCache; | ||||||
| 
 | 
 | ||||||
| // TODO Rename query.h:SymbolKind to another name; change int16_t to uint8_t
 | // TODO Rename query.h:SymbolKind to another name
 | ||||||
| // clang/Index/IndexSymbol.h clang::index::SymbolKind
 | // clang/Index/IndexSymbol.h clang::index::SymbolKind
 | ||||||
| enum class ClangSymbolKind : int16_t { | enum class ClangSymbolKind : uint8_t { | ||||||
|   Unknown, |   Unknown, | ||||||
| 
 | 
 | ||||||
|   Module, |   Module = 1, | ||||||
|   Namespace, |   Namespace, | ||||||
|   NamespaceAlias, |   NamespaceAlias, | ||||||
|   Macro, |   Macro, | ||||||
| 
 | 
 | ||||||
|   Enum, |   Enum = 5, | ||||||
|   Struct, |   Struct, | ||||||
|   Class, |   Class, | ||||||
|   Protocol, |   Protocol, | ||||||
| @ -95,23 +95,23 @@ enum class ClangSymbolKind : int16_t { | |||||||
|   Union, |   Union, | ||||||
|   TypeAlias, |   TypeAlias, | ||||||
| 
 | 
 | ||||||
|   Function, |   Function = 12, | ||||||
|   Variable, |   Variable, | ||||||
|   Field, |   Field, | ||||||
|   EnumConstant, |   EnumConstant, | ||||||
| 
 | 
 | ||||||
|   InstanceMethod, |   InstanceMethod = 16, | ||||||
|   ClassMethod, |   ClassMethod, | ||||||
|   StaticMethod, |   StaticMethod, | ||||||
|   InstanceProperty, |   InstanceProperty, | ||||||
|   ClassProperty, |   ClassProperty, | ||||||
|   StaticProperty, |   StaticProperty, | ||||||
| 
 | 
 | ||||||
|   Constructor, |   Constructor = 22, | ||||||
|   Destructor, |   Destructor, | ||||||
|   ConversionFunction, |   ConversionFunction, | ||||||
| 
 | 
 | ||||||
|   Parameter, |   Parameter = 25, | ||||||
|   Using, |   Using, | ||||||
| }; | }; | ||||||
| MAKE_REFLECT_TYPE_PROXY(ClangSymbolKind, std::underlying_type<ClangSymbolKind>::type); | MAKE_REFLECT_TYPE_PROXY(ClangSymbolKind, std::underlying_type<ClangSymbolKind>::type); | ||||||
|  | |||||||
| @ -20,10 +20,17 @@ std::string GetBaseName(const std::string& path) { | |||||||
| 
 | 
 | ||||||
| }  // namespace
 | }  // namespace
 | ||||||
| 
 | 
 | ||||||
|  | // uint8_t
 | ||||||
|  | void Reflect(Reader& visitor, uint8_t& value) { | ||||||
|  |   value = (uint8_t)visitor.GetInt(); | ||||||
|  | } | ||||||
|  | void Reflect(Writer& visitor, uint8_t& value) { | ||||||
|  |   visitor.Int(value); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| // int16_t
 | // int16_t
 | ||||||
| void Reflect(Reader& visitor, int16_t& value) { | void Reflect(Reader& visitor, int16_t& value) { | ||||||
|   if (visitor.IsInt()) |   value = (int16_t)visitor.GetInt(); | ||||||
|     value = (int16_t)visitor.GetInt(); |  | ||||||
| } | } | ||||||
| void Reflect(Writer& visitor, int16_t& value) { | void Reflect(Writer& visitor, int16_t& value) { | ||||||
|   visitor.Int(value); |   visitor.Int(value); | ||||||
|  | |||||||
| @ -131,6 +131,9 @@ void ReflectMemberEnd(TVisitor& visitor, T& value) { | |||||||
| } | } | ||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
|  | // uint8_t
 | ||||||
|  | void Reflect(Reader& visitor, uint8_t& value); | ||||||
|  | void Reflect(Writer& visitor, uint8_t& value); | ||||||
| // int16_t
 | // int16_t
 | ||||||
| void Reflect(Reader& visitor, int16_t& value); | void Reflect(Reader& visitor, int16_t& value); | ||||||
| void Reflect(Writer& visitor, int16_t& value); | void Reflect(Writer& visitor, int16_t& value); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user