redhat-developer / redhat-developer/vscode-java
Add Xlint Support
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.3k
- Forks
- 546
- Merge medio
- 20 h 1 min
- PR fusionados (30 d)
- 11
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza rastreando cómo la extensión invoca javac y muestra las advertencias del compilador; el issue no menciona archivos del repositorio, pruebas ni puntos de entrada. Usa como referencia el ejemplo proporcionado de Test.java y el comportamiento de javac -Xlint, y define como terminado el soporte de las categorías de advertencias de Xlint solicitadas con activación configurable por el usuario.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, vscode
- Área
- tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100