Intellij IDE Malforms Header Comment
已回答
My team has a standardized header for our Java files. Example shown below
/*
* ###############################
* # Date | Author | Description #
* ###############################
* # date |name | sample desc #
* ###############################
*/I tried adding the above as a default header to be created for all new java files. But Intellij does strange formatting and completely Malforms the header to something like below.
How do I prevent intellij from malforming the template like so? Is # a reserved symbol?
/*
* * # Date | author | description
* * # date | name | sample desc
* */
请先登录再写评论。
Yes, IntelliJ IDEA uses Velocity template engine and it's a reserved character there that needs to be escaped.
See here for more details:
https://stackoverflow.com/questions/53744/how-to-escape-a-in-velocity
https://intellij-support.jetbrains.com/hc/en-us/community/posts/207033225-How-to-Escape-Character-in-File-Template