Repository navigation
Conversation
a6de45d to
bff041f
Compare
bff041f to
c393ba1
Compare
|
Can this along with the change on the language server be revived now that we've updated to the 3.17 spec ? |
I'm looking at this. The UX change (some UI limitation) of this PR is mentioned in #2376 (comment) |
c393ba1 to
819c31a
Compare
Signed-off-by: Shi Chen <[email protected]>
vscode-languageclient's LanguageClient constructor already calls registerBuiltinFeatures(), which registers TypeHierarchyFeature internally. The explicit registration added here is not just redundant, it no longer compiles: the package now restricts its exports map to '.', './node', './browser', so the deep import 'vscode-languageclient/lib/common/typeHierarchy' is no longer a valid module path, and TypeHierarchyFeature isn't re-exported from the public API either. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The LSP-based rewrite simplified TypeHierarchyTreeDataProvider down to always resolving children eagerly before deciding collapsible state, and dropped three refinements the pre-rewrite custom-protocol version had: - java.typeHierarchy.lazyLoad: the setting existed in package.json but nothing read it anymore, so toggling it had no effect. - The java.lang.Object subtype placeholder: expanding Object with no placeholder would otherwise invoke typeHierarchy/subtypes for every class in the workspace. - The shared getThemeIcon helper in themeUtils.ts, duplicated here as a private static copy instead of reused. Co-Authored-By: Claude Sonnet 5 <[email protected]>
819c31a to
26c0299
Compare
|
|
@datho7561 Manual test seems to work on the single testable code path. No obvious errors, expected behavior received. LMK what you think. |
|
I'll try it out manually quickly, I think I saw that as of the current release there are two "Type Hierarchy" entries in the context meny so hopefully this resolves that. |
|
It seems like this renames the first of the two "Show Type Hierarchy" entries to "Show Class Hierarchy". I don't fully understand what the difference is. They both appear to open the same view? With roughly the same information? |
|
The class hierarchy shows both sub and super types without having to toggle between the two, which I think on it's own is a helpful feature, and I prefer to the separate sub and super hierarchies. However, having two separate context menu items and effectively three separate views is very confusing for the end user. I think we should migrate over to the standard VS Code-provided type hierarchy system. This will reduce the complexity of vscode-java and will be less confusing to end users. |
|
Just gonna dump some claude analysis here bc i'm too tired to sumarize: Here's the actual delegation chain for each:
Your instinct is right for 2 of the 3: Supertype/Subtype Hierarchy are duplicated work — they add nothing over the |
|
Here's some more: The replacement click path:
So the full replacement for our two custom commands: right-click → "Show Type Hierarchy" (1 click) → toggle button in This also directly confirms the design intent I found earlier: VS Code's own team deliberately left the "combined |
I don't think that's right whatsoever. They built VS Code to be a TypeScript IDE. JavaScript/TypeScript is also single inheritance. I think they didn't like our separate class hierarchy because it's redundant given there's already super and sub type hierarchies. The separate class hierarchy is more a hold over from Eclipse, from what I understand. I'll file a new issue and do a write up explaining what I think is needed for this change. |
|
Closing this, as we've opted to go in a different direction. |
Requires eclipse-jdtls/eclipse.jdt.ls#2033
The change is able to review/merge, but we will get several BREAKING changes, so feel free to discuss we can now continue the process or wait for further changes.
Pros:
Cons:
The type hierarchy in LSP only supports supertype hierarchy and subtype hierarchy, no class hierarchy. We should still hold custom implementations about the class hierarchy view.
Since "Show Type Hierarchy" is contributed from language client/vscode itself, we have no way to control its behavior, so the default view of "Show Type Hierarchy" would be the subtype hierarchy view. We added a new entry "Show Class hierarchy" to open the class hierarchy view by default.

As for those types have no children, the star will always show there. This is also the limitation of current call hierarchy view.
