Skip to content

Proposal: to better structure symbol details add LSPArray languageSpecificDetails property to callHierarchy and documentSymbol etc. #2118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
i-garrison opened this issue Mar 20, 2025 · 0 comments
Labels
call hierarchy document symbols feature-request Request for new features or functionality
Milestone

Comments

@i-garrison
Copy link

i-garrison commented Mar 20, 2025

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.

@dbaeumer dbaeumer added feature-request Request for new features or functionality document symbols call hierarchy labels Mar 21, 2025
@dbaeumer dbaeumer added this to the Backlog milestone Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
call hierarchy document symbols feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants