In a html file, there is some code used custom template-language:
<script type="text/javascript"> function ($scope, JsRoutes) { $scope.rows = [ ${"#{list rows, as: 'row', separator: ','}"} { #{list fieldConfigs, as: 'f', separator: ','} ${f.name} : ${'$'}{row.${f.name}.toJson()}#{/list} } ${'#{/list}'} ] } </script>
Is it possible to configure intellij-idea not to format it(but format the other part of the document)? Since idea will make it hard to read after formatting:
<script type="text/javascript"> function ($scope, JsRoutes) { $scope.rows = [ ${"#{list rows, as: 'row', separator: ','}"} { #{list fieldConfigs, as: 'f', separator: ','} ${f.name} : ${'$'}{ row.${f.name}.toJson() }#{/list} } ${'#{/list}'} ] } </script>
You must go to Preferences -> Code Style -> General -> Formatter Control and check Enable formatter markers in comments for this to work.
Press Ctrl+E, C or choose Code | Reformat and Cleanup… from the main menu . In the Code Cleanup dialog that opens, you can check and optionally change the scope for cleaning code and choose a cleanup profile to apply.
In my version EAP 13.1, you must enable the following option in settings,
Preferences
-> Code Style
-> General
-> Formatter Control
-> Enable formatter markers in comments
before you can use these comments,
// @formatter:off // @formatter:on
or these (depending on language):
<!--@formatter:off--> <!--@formatter:on-->
Screenshot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With