redhat-developer / redhat-developer/vscode-java
Add Xlint Support
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 546
- Ø Merge
- 20 Std. 1 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit nachzuverfolgen, wie die Erweiterung javac aufruft und Compiler-Warnungen weitergibt; im Issue werden keine Repository-Dateien, Tests oder Einstiegspunkte genannt. Verwende das bereitgestellte Test.java-Beispiel und das Verhalten von javac -Xlint als Referenzen, und definiere als erledigt, dass die angeforderten Xlint-Warnungskategorien mit einer vom Benutzer konfigurierbaren Aktivierung unterstützt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, vscode
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100