Include Return Type Annotations in Method Hover Tooltip
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- java, typescript, vscode
调研方向
首先定位 VS Code 扩展中的 Java hover-tooltip 实现,并跟踪方法签名的渲染方式。使用 @Nullable 和 List<@NonNull String> 示例作为预期情况;当声明返回注解和类型使用返回注解都出现在 hover 输出中,并且相应的测试已添加或更新时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Description
When hovering over a method in the editor, the tooltip currently shows the method signature and Javadoc (if available). However, annotations applied to the method’s return type are not displayed.
This feature request proposes enhancing the hover tooltip to include annotations declared on the return type.
Example
public @Nullable String getName() {
return name;
}
or with type-use annotations:
public List<@NonNull String> getNames() {
return names;
}
Current Behavior:
Hover tooltip shows:
String getName()
Expected Behavior:
Hover tooltip shows:
@Nullable String getName()
and for generics:
List<@NonNull String> getNames()
Motivation / Use Case
Return type annotations (e.g., nullability annotations like @Nullable, @NonNull, or custom type-use annotations) are critical for understanding API contracts, static analysis, and preventing runtime errors.
Not displaying them in hover:
- Hides important semantic information
- Forces developers to navigate to the declaration
- Reduces the usefulness of hover as a quick inspection tool
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 547
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
redhat-developer/vscode-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
redhat-developer/vscode-java#4426 ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
redhat-developer/vscode-java#4506 · 3 条评论 · 4 个 reaction ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
redhat-developer/vscode-java#4505 · 2 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 52/100
redhat-developer/vscode-java#4504 · 3 条评论 · 1 个 reaction ·
-
bug
难度 3/5 1-2 天 新手友好度 62/100
redhat-developer/vscode-java#4502 ·
查看 redhat-developer/vscode-java 的全部 Issue
相似的 Issue
-
Type/Bug
难度 2/5 1-3 小时 新手友好度 78/100
OpenNSW/nsw-srilanka#497 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
难度 1/5 1 小时以内 新手友好度 88/100
digidem/comapeo-cloud-app#403 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 78/100