Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Make Ctrl+T more context-dependent

未关闭
#899 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
32/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
java, typescript, vscode

调研方向

payload 未指定源文件或测试;首先在 VS Code 中对突出显示的 Java 方法复现 Ctrl+T,并将现有行为与 Eclipse 进行比较。完成的标准是,树会跟随已声明类型的相关超类和子类方法实现,并且选择节点时会导航到该方法实现,而不是类型声明。

由索引模型根据 Issue 内容生成。

描述

ai-triaged enhancement feature-request

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.

主要语言
TypeScript
星标
352
派生
166
平均合并
13 小时 16 分钟
30 天内合并 PR
27

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-java-pack 的其他 Issue

查看 microsoft/vscode-java-pack 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。