-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parser): no longer ignore whole block when prettier-ignore at start
closes #505
- Loading branch information
1 parent
540d1aa
commit b56e69f
Showing
4 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/prettier-plugin-java/test/unit-test/prettier-ignore/block/_input.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package tech.jhipster; | ||
|
||
import java.util.Map; | ||
|
||
public class StrangePrettierIgnore { | ||
|
||
private StrangePrettierIgnore() {} | ||
|
||
public static void drinkBeers() { | ||
// prettier-ignore | ||
Map<String, String> beers = Map.of( | ||
"beer1", "Gulden Draak", | ||
"beer2", "Piraat", | ||
"beer3", "Kapittel" | ||
); | ||
|
||
System.out.println(beers); // not well formated here | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/prettier-plugin-java/test/unit-test/prettier-ignore/block/_output.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package tech.jhipster; | ||
|
||
import java.util.Map; | ||
|
||
public class StrangePrettierIgnore { | ||
|
||
private StrangePrettierIgnore() {} | ||
|
||
public static void drinkBeers() { | ||
// prettier-ignore | ||
Map<String, String> beers = Map.of( | ||
"beer1", "Gulden Draak", | ||
"beer2", "Piraat", | ||
"beer3", "Kapittel" | ||
); | ||
|
||
System.out.println(beers); // not well formated here | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters