redhat-developer / redhat-developer/vscode-java
Add Xlint Support
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
My apologies in advance if this feature is already supported/implemented and I could not find it.
This extension does an excellent job of reporting most warnings, but recently I came across several warnings in my project that this extension was not reporting but I found through compiling with the -Xlint flag.
Take this SSCCE for example:
public class Test
{
public static void main(String[] args)
{
int x = 3;
int y = (int)x;
System.out.println(y);
}
}
This code runs perfectly fine with this extension with no warnings, but if you compile it with javac -Xlint Test.java, you will get this:
Test.java:6: warning: [cast] redundant cast to int
int y = (int)x;
^
1 warning
This is just one example but it seems there are other types of useful warnings that the Xlint flag gives that this extension does not report, such as not marking non-serializable fields as transient.
I understand the Xlint flag is comprised of many subflags (search for Xlint on this man page to see the options) that can be turned on and off to report or ignore different types of warnings, and users may not want to see all the warnings that -Xlint:all reports. Thus, it would nice for these additional warnings to not only be supported, but for the user to have the option to turn these individual warning categories on or off as you can when manually compiling your project.
My thanks in advance for your help!
Environment
- Operating System: Windows 10
- JDK version: 17.0.4.1
- Visual Studio Code version: 1.78.2
- Java extension version: 1.19.2023052004
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、拡張機能がどのように javac を呼び出し、コンパイラーの警告を表面化しているかを追跡します。issue では、リポジトリのファイル、テスト、エントリーポイントは指定されていません。提供された Test.java の例と javac -Xlint の動作を参照し、ユーザーが有効化を設定できる形で、要求された Xlint 警告カテゴリーをサポートすることを完了の定義とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, vscode
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100