Multiline comment formatting not idempotent
See original GitHub issueI’m seeing an issue with multiline comments getting extra indentation each time they get run through prettier-java
Input:
public class Example {
public void method() {
/*
multiline comment
*/
}
}
Output: (after running prettier ~5 times)
public class Example {
public void method() {
/*
multiline comment
*/
}
}
Each run of prettier seems to indent the comment a little more.
The issue doesn’t manifest if each line of the comment is prefixed with an asterisk (although the formatting in this case still looks a little bit off), for example:
Input:
public class Example {
public void method() {
/*
* multiline comment
*/
}
}
Output:
public class Example {
public void method() {
/*
* multiline comment
*/
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How To Set Format Of Multiline Comment in IntelliJ
File > Settings (Ctrl + Alt + S on Windows); Editor > Live Templates; Add a new one or edit an existing one,...
Read more >Ruby Style Guide
Use only spaces for indentation. No hard tabs. Indentation. Use two spaces per indentation level (aka soft tabs).
Read more >Using filters to manipulate data - Ansible Documentation
Using filters to manipulate data . Filters let you transform JSON data into YAML data, split a URL to extract the hostname,...
Read more >Configuration · Scalafmt - Scalameta
Warning: this rewrite might cause non-idempotent formatting, formatter might need to be run twice. This rule cannot be used with rewrite.scala3.
Read more >RFC 7231: Hypertext Transfer Protocol (HTTP/1.1)
Idempotent Methods A request method is considered "idempotent" if the intended effect ... A standard format for such a representation is not defined...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also tried running on #278 and got the same result
Good insight ! That matches what I am thinking after taking a quick look at this issue