google / bamboo-soy

An intellij plugin supporting Closure Template language (Soy)
Apache License 2.0
48 stars 27 forks source link

Auto formatter adds leading space and/or newline to rest-of-line comment #164

Closed iannightingale closed 4 years ago

iannightingale commented 5 years ago

Firstly, thanks for the great plugin! It has made soy development a lot more enjoyable.

I had a question surrounding auto formatting end-of-line comments. I've observed the following behavior:

{template .test}
   // Above soy block, has extra leading space but no newline.
  {if 1 == 1}

  {/if}

   // Above HTML, has extra leading space and extra line.

  <div></div>

  /* Working as intended. */
  {if 1 == 1}

  {/if}

  /* Working as intended. */
  <div></div>

{/template}

I know the Closure Template comments documentation mentions whitespace being required for end-of-line comments, but I don't believe it requires comments being misaligned/separated with the line they describe, as seen above.

This isn't a pressing issue as single-star comments seem to work as intended, but my preference would be to use end-of-line comments without superfluous and misaligned whitespace.

Thanks!

crdev commented 4 years ago

This was fixed by https://github.com/google/bamboo-soy/pull/185