mirror of
				https://github.com/MaskRay/ccls.git
				synced 2025-10-30 20:22:38 +00:00 
			
		
		
		
	Add lsSymbolKind::StaticMethod (extension) and set parentKind
This commit is contained in:
		
							parent
							
								
									9217393a78
								
							
						
					
					
						commit
						488f6cc962
					
				| @ -125,9 +125,9 @@ lsSymbolKind GetSymbolKind(CXIdxEntityKind kind) { | ||||
|     case CXIdxEntity_ObjCInstanceMethod: | ||||
|       return lsSymbolKind::Method; | ||||
|     case CXIdxEntity_ObjCClassMethod: | ||||
|       return lsSymbolKind::Method; | ||||
|       return lsSymbolKind::StaticMethod; | ||||
|     case CXIdxEntity_CXXStaticMethod: | ||||
|       return lsSymbolKind::Method; | ||||
|       return lsSymbolKind::StaticMethod; | ||||
|     case CXIdxEntity_ObjCProperty: | ||||
|       return lsSymbolKind::Property; | ||||
|     case CXIdxEntity_CXXStaticVariable: | ||||
|  | ||||
| @ -126,6 +126,8 @@ void EmitSemanticHighlighting(QueryDatabase* db, | ||||
|         if (short_name.compare(0, 8, "operator") == 0 || | ||||
|             short_name.compare(0, 27, "function<type-parameter-0-0") == 0) | ||||
|           continue;  // applies to for loop
 | ||||
|         if (def->spell) | ||||
|           parent_kind = def->spell->kind; | ||||
|         kind = def->kind; | ||||
|         detailed_name = short_name; | ||||
| 
 | ||||
| @ -149,6 +151,8 @@ void EmitSemanticHighlighting(QueryDatabase* db, | ||||
|       } | ||||
|       case SymbolKind::Var: { | ||||
|         if (const QueryVar::Def* def = db->GetVar(sym).AnyDef()) { | ||||
|           if (def->spell) | ||||
|             parent_kind = def->spell->kind; | ||||
|           kind = def->kind; | ||||
|           storage = def->storage; | ||||
|           detailed_name = def->ShortName(); | ||||
| @ -157,6 +161,8 @@ void EmitSemanticHighlighting(QueryDatabase* db, | ||||
|       } | ||||
|       case SymbolKind::Type: { | ||||
|         if (const QueryType::Def* def = db->GetType(sym).AnyDef()) { | ||||
|           if (def->spell) | ||||
|             parent_kind = def->spell->kind; | ||||
|           kind = def->kind; | ||||
|           detailed_name = def->detailed_name; | ||||
|         } | ||||
|  | ||||
| @ -112,6 +112,7 @@ enum class lsSymbolKind : uint8_t { | ||||
|   // See also https://github.com/Microsoft/language-server-protocol/issues/344 for new SymbolKind
 | ||||
|   // clang/Index/IndexSymbol.h clang::index::SymbolKind
 | ||||
|   Parameter = 13, | ||||
|   StaticMethod = 254, | ||||
|   Macro = 255, | ||||
| }; | ||||
| MAKE_REFLECT_TYPE_PROXY(lsSymbolKind); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user