redhat-developer / redhat-developer/vscode-java

// @formatter:off should impact save actions too

Abierto
#2,397 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

enhancement formatter upstream
Lenguaje dominante
TypeScript
Estrellas
2.3k
Forks
546
Merge medio
20 h 1 min
PR fusionados (30 d)
11

Descripción

This is probably a new feature request rather than a bug.

Currently, // @formatter:off and // @formatter:on are great for having VSCode not format part of your file. This behavior could also extend to save actions, not just formatting. For example, when using Args4J, you annotate fields with @Option and those fields are set for you based on command line arguments (through some kind of reflection black magic). If one of those fields is final, then Args4J throws an exception. Example of a field with the annotation:

@Option(name = "--write-tps", handler = LongOptionHandler.class, usage = "The target write tps when updating the table")
private Long writeTps = 1L;

When saving, VSCode will add final:

@Option(name = "--write-tps", handler = LongOptionHandler.class, usage = "The target write tps when updating the table")
private final Long writeTps = 1L;

but that is not desirable in this case.

Ideally we could use comments to turn off adding final, like this:

// @formatter:off
@Option(name = "--read-capacity", handler = LongOptionHandler.class, usage = "The target read capacity to utilize when scanning the table")
private Long readCapacity = 1L;

@Option(name = "--write-tps", handler = LongOptionHandler.class, usage = "The target write tps when updating the table")
private Long writeTps = 1L;

@Option(name = "--no-dry-run", handler = BooleanOptionHandler.class, usage = "If set to true, the backfill will be done to records needing it")
private Boolean noDryRun = false;
// @formatter:on

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en la ruta de la acción de guardado de VSCode Java y rastrea cómo se gestiona actualmente // @formatter:off/on para el formateo. Se considera terminado cuando las acciones de guardado dejan la región anotada sin cambios, incluidos los campos de Args4J mostrados aquí, mientras el comportamiento fuera de los marcadores permanece intacto.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java, typescript, vscode
Área
developer-experience, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.