redhat-developer / redhat-developer/vscode-java
Add Xlint Support
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 2.3k
- Fork
- 546
- Merge medio
- 20h 1m
- PR unite (30g)
- 11
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando il modo in cui l’estensione invoca javac ed espone gli avvisi del compilatore; l’issue non indica file del repository, test o punti di ingresso. Usa come riferimenti l’esempio Test.java fornito e il comportamento di javac -Xlint, e considera completato il lavoro quando sono supportate le categorie di avvisi Xlint richieste con abilitazione configurabile dall’utente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, vscode
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100