Remove Redundant Type Hierarchy

クローズ
#4,560 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@MeherSru がすでに取り組んでいます。

2026年10月28日 から。

  • #4565 @MeherSru による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
66/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript, vscode
領域
tooling

調査の方向性

Start in package.json and find the command IDs and menu contributions for the custom type hierarchy, then grep those IDs across the extension. Read typeHierarchyTree.ts and references-view.d.ts to see what can be deleted, and check the command implementations registered elsewhere. Done means the duplicate "Show Type Hierarchy" entry is gone, the custom commands and UI code are removed, and the extension builds and tests pass.

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug
Currently, when you right click a class name, there are two context menu entries called "Show Type Hierarchy".

One is contributed by us (vscode-java) and one is a default one provided by VS Code.

We should remove the entry provided by us, along with all the associated UI code, since the default type hierarchy UI provided by VS Code is sufficient, and removing code with reduce the complexity of this project. VS Code provides this UI automatically, since jdtls advertises it supports type hierarchy. The other entry exists because we implemented type hierarchy support before it was added into the LSP specification.

There is one minor difference between our custom type hierarchy UI and the default UI: we provide a "Class Hierarchy" view that shows both super classes and sub classes at the same time. However, after talking this through with Rob, I don't think it's worth saving this UI, since then there would be two different ways to access the same information, which would be confusing to end users.

Here's a list of things we'll need to remove: (hopefully complete but there might be other things as well):

  1. The UI itself, i.e. typeHierarchyTree.ts
  2. The typings we have for interacting with VS Code's references view API (references-view.d.ts)
  3. The commands to open the type hierarchy view (these are registered in package.json and implemented throughout the codebase; grepping for the id listed in the package.json should find the implementations)
  4. The registration of various commands (also in the package.json)
  5. There's separate "Subtype hierarchy" and "Supertype hierarchy" commands that are referenced in code, but only appear in the command palette and currently don't seem to function. These should be removed

See https://github.com/redhat-developer/vscode-java/pull/2376 for some more context

To Reproduce
Steps to reproduce the behaviour:

  1. Make a type that inherits from a few other types:
public class B extends A implements Serializable {

}
  1. Right click on the type name (in this case B).
  2. There are two "Show Type Hierarchy"

Expected behaviour
There should instead be one "Show Type Hierarchy" entry

Environment

  • Operating System: Linux (but it's not Linux specific)
  • JDK version: 25
  • Visual Studio Code version: 1.143.1
  • Java extension version: 1.59.0

Additional Information

主要言語
TypeScript
スター
2.3k
フォーク
549
平均マージ
3日 22時間
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

redhat-developer/vscode-java のほかの issue

redhat-developer/vscode-java の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。