Wrong indentation on if-then with comments
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Commencez par inspecter le code source du formatter autour de la ligne 331 et reproduisez l’extrait signalé avec une condition if scindée et un commentaire en fin de ligne. Suivez le calcul de l’indentation du bloc then, puis ajoutez ou mettez à jour la couverture pour ce cas et vérifiez que la sortie formatée indente correctement prd.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Comments at the end of this if makes the then block to not get indented.
if (prd.source()
.isPresent()) // exclude generated productions like casts
prd = null;
Line 331. IntelliJ reports this as well.
I think the problem comes from the if condition that got split into two lines. If I move the comment to a separate line, then indentation works as expected.
- Langage dominant
- Java
- Étoiles
- 6.2k
- Forks
- 936
- Merge moyen
- 6 min
- PR mergées (30 j)
- 3
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.
Autres issues de google/google-java-format
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
google/google-java-format#1094 · 1 commentaire ·
-
Complementary Teamups Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
google/google-java-format#1450 · 1 réaction ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
google/google-java-format#1439 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
google/google-java-format#1436 · 2 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
google/google-java-format#1428 · 4 commentaires ·
Toutes les issues de google/google-java-format
Issues similaires
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Ouvertearea/plugin
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Add canonical URLs and a sitemap Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/rocketmq-dashboard#5064 ·