microsoft / microsoft/vscode-java-pack
Make Ctrl+T more context-dependent
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 352
- フォーク
- 166
- 平均マージ
- 17時間 47分
- マージ済み PR(30日)
- 32
説明
Suggestion
When pressing Ctrl+T when highlighting a method, we see the method hierarchy instead of the type hierarchy and navigation leads us directly to the method's declaration within the selected type and not to the declaration of the type itself.
Use Cases
I want to be able to easily navigate to all implementations of subclasses as well as super classes of a certain method to better understand how a certain type affects implementation of the selected method.
Examples
Given the following class hierarchy:
class A {
public String generateGreeting() {
return "Hi!";
}
}
class B extends A {
@Override
public String generateGreeting() {
return "Hello!";
}
}
class C extends A {
@Override
public String generateGreeting() {
return "Guten Tag!";
}
}
When highlighting generateGreeting() and pressing Ctrl+T I want to see a tree where nodes represent classes implementing the highlighted method. The nodes' nesting represents the class hierarchy. The nodes shown depend on the declared type of the field/variable on the caller side. In case the method is highlighted at its declaration the declared type would be the class enclosing the method. All sub classes and super classes of the declared type implementing the method must be shown as nodes in the tree (not only sub classes). When clicking a node, VS Code navigates to the corresponding method implementation of the highlighted method, not to the beginning of the type declaration (current behavior):
Situation 1:
A a = new B();
a.generateGreeting();
Declared type would be A, so I want to see implementations of A.generateGreeting and B.generateGreeting and C.generateGreeting as nodes in the tree
Situation 2:
B b = new B();
b.generateGreeting();
Declared type would be B, so I want to see implementations of A.generateGreeting and B.generateGreeting as nodes in the tree, but not C.generateGreeting because it is neither a subclass nor a super class of B.
You could check Eclipse's behavior for an existing implementation.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
payload にはソースファイルやテストが記載されていません。まず VS Code で強調表示された Java メソッドに対して Ctrl+T を再現し、既存の動作を Eclipse と比較してください。完了条件は、ツリーが宣言された型の関連するスーパークラスおよびサブクラスのメソッド実装に従い、ノードを選択すると型の宣言ではなくそのメソッド実装へ移動することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, typescript, vscode
- 領域
- developer-experience, tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 32/100