diff --git a/src/clang_symbol_kind.h b/src/clang_symbol_kind.h index c168ae79..7e34dfac 100644 --- a/src/clang_symbol_kind.h +++ b/src/clang_symbol_kind.h @@ -38,6 +38,8 @@ enum class ClangSymbolKind : uint8_t { Destructor, ConversionFunction, + // Used for both function and template parameters. + // Clients can differentiate based on StorageClass. Parameter = 25, Using, }; diff --git a/src/indexer.cc b/src/indexer.cc index ab865bb3..913416f3 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1197,6 +1197,7 @@ ClangCursor::VisitResult TemplateVisitor(ClangCursor cursor, if (ref_index->def.detailed_name.empty()) { ref_index->def.definition_spelling = ref_cursor.get_spelling_range(); ref_index->def.definition_extent = ref_cursor.get_extent(); + ref_index->def.kind = ClangSymbolKind::Parameter; SetVarDetail(ref_index, ref_cursor.get_spelling(), ref_cursor, nullptr, true, db, data->param); @@ -1252,6 +1253,7 @@ ClangCursor::VisitResult TemplateVisitor(ClangCursor cursor, ref_index->def.detailed_name = ref_cursor.get_spelling(); ref_index->def.short_name_offset = 0; ref_index->def.short_name_size = ref_index->def.detailed_name.size(); + ref_index->def.kind = ClangSymbolKind::Parameter; } UniqueAdd(ref_index->uses, cursor.get_spelling_range()); } @@ -1273,6 +1275,7 @@ ClangCursor::VisitResult TemplateVisitor(ClangCursor cursor, ref_index->def.detailed_name = ref_cursor.get_spelling(); ref_index->def.short_name_offset = 0; ref_index->def.short_name_size = ref_index->def.detailed_name.size(); + ref_index->def.kind = ClangSymbolKind::Parameter; } UniqueAdd(ref_index->uses, cursor.get_spelling_range()); }