Description
Why
Useful attributes for a C++
symbol displayed in call hierarchy or just searched for would probably include (but not limited to) signature, scope, return value, access specifier.
Similar set of useful attributes for other languages will likely differ but at least for C
, C++
and Java
this set already has more than two entries. Currently implementations are probably trying to fit all of these data items into single detail
field of CallHierarchyItem
, DocumentSymbol
etc. using funny encoding which needs to be parsed by hand.
How
To improve this, let's add another property languageSpecificDetails
of type LSPArray to CallHierarchyItem
, DocumentSymbol
etc.
This new property would be used by language server to communicate useful language-specific attributes as key/value pairs, easing life of client and allowing for more attributes to be passed.
Further steps
Some useful attributes like method signature
appear to be common to many different languages and servers may choose to unify corresponding key names across supported languages, allowing for better unified structured UI implementations. Well-known keys shoud probably be not a fixed set but just a list of strings (with descriptions?) allowing for any extension.
Originally discussed in clangd/clangd#1940 regarding extra details for callHierarchy.