Reformat code -- any way to keep spacing/formatting in comment blocks?

I've got a large project that I'm trying to implement a style guide in -- and using Reformat Code gets me 80% of the way there. However, most of our files and methods begin with a large ngdoc/jsdoc comment block that includes example code (html, javascript, xml). Unfortunately, reformatting forces many of these example blocks to align with the initial comment line. Is there a way to make it retain the formatting (or skip comment formatting altogether when reformatting?)

Ex:

 
/**
* @ngdoc directive
* @example
   <example name="oxBreadcrumbs" module="oxBreadcrumbsExample">
     <file name="index.html">
       <div ng-controller="example">
 
       </div>
 
     </file>
 
   </example>

*/

Will become:

/**
* @ngdoc directive
* @example
<example name="oxBreadcrumbs" module="oxBreadcrumbsExample">
<file name="index.html">
<div ng-controller="example">
</div>
</file>
</example>

*/

Any way to avoid this?

0
1 comment

Known issue - https://youtrack.jetbrains.com/issue/WEB-11958.
Unfortunately it's not possible to turn formatting off for a doc comment - see https://youtrack.jetbrains.com/issue/IDEA-132034

0

Please sign in to leave a comment.