redhat-developer / redhat-developer/vscode-java
// @formatter:off should impact save actions too
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 2.3k
- Forks
- 546
- Merge moyen
- 20 h 1 min
- PR mergées (30 j)
- 11
Description
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le chemin de l’action d’enregistrement de VSCode Java et suivez la manière dont // @formatter:off/on est actuellement géré pour le formatage. Le travail est terminé lorsque les actions d’enregistrement laissent la région annotée inchangée, y compris les champs Args4J présentés ici, tandis que le comportement en dehors des marqueurs reste intact.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java, typescript, vscode
- Domaine
- developer-experience, tooling
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100