redhat-developer / redhat-developer/vscode-java

Include Return Type Annotations in Method Hover Tooltip

オープン
#4,407 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、VS Code 拡張機能内の Java のホバーツールチップ実装を見つけ、メソッドシグネチャがどのようにレンダリングされるかを追跡します。期待されるケースとして @Nullable と List<@NonNull String> の例を使用します。宣言の戻り値アノテーションと型使用の戻り値アノテーションの両方がホバー出力に表示され、対応するテストが追加または更新されていれば完了です。

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

評価

技術スタック
java, typescript, vscode
領域
developer-experience, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
52/100

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

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