mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-26 09:31:59 +00:00
Use symbol kind 'Parameter' for template parameters
Clients can distinguish between function and template parameters based on storage class.
This commit is contained in:
parent
ce6f1c7294
commit
74f9be1d6f
@ -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,
|
||||
};
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user