-
Notifications
You must be signed in to change notification settings - Fork 145
Type hierarchy view improvements #875
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
base: master
Are you sure you want to change the base?
Type hierarchy view improvements #875
Conversation
stephan-razin
commented
Sep 28, 2025
- Fix collapsible state for classes without children.
- Fix base-classes hierarchy displaying for classes without children.
- Improve icons and details information like native vscode Peek Type Hierarchy.
a1c8cc7
to
41fc05e
Compare
The code in Are you using an older version of clangd than clangd 16? Or are you somehow seeing this code being used with newer clangd versions? |
Standard type hierarchy works, and clangd.typeHierarchyView works also. It's registerd here. So, view is available independing of server version. If this view is deprecated, this PR has no sense. But, IMHO, clangd.typeHierarchyView looks more useful:
Standard type hierarchy for C: |
Good find. I think this is unintentional / an oversight though: the context menu item to invoke call hierarchy is made conditional on the server only supporting the non-standard extension here, and the command should have been made conditional too, but it seems this was overlooked.
Are you referring to the fact that our type hierarchy view shows both subtypes (derived classes) and supertypes (base classes) in the same tree? The standard one can also show supertypes, just not in the same tree (there is a "Show supertypes" button at the top of the type hierarch view). |
Yes, I know about "show supertypes" button, and it's looks like a matter of taste, which one is better. And also one point: clangd hierarchy does not show expand button for types without subtypes, but standard one shows it always. So, if clangd type hierarchy is deprecated and used for old versions compatibiliy only, I guess you can reject this PR. |
I do agree that's nicer. VSCode's standard type hierarchy view could be changed to have this behaviour too. You could consider filing an issue about that in the https://github.com/microsoft/vscode/ repo, and if fixed then users of the type hierarchy view in all applicable languages would benefit.
Yeah, I think that, since the only reason we had our own type hierarchy view to begin with was that there wasn't a standard one at the time, we should be moving in the direction of deprecating/removing ours rather than enhancing it. cc @hokein and @kadircet in case you have a different opinion |
+1, the existing |