casid / jte-intellij

IntelliJ plugin for jte template files.
https://github.com/casid/jte
Apache License 2.0
23 stars 5 forks source link

Improve auto formatting #27

Open casid opened 1 year ago

casid commented 1 year ago

Content blocks

Content blocks with more than one line should be formatted, so that @` and ` are moved on their own line, and the content is indented.

For example

Before

!{var content = @`<a href="${url}" target="_blank" class="${anchorClass}">
      ${url}
   </a>`;}

After

!{var content = @`
   <a href="${url}" target="_blank" class="${anchorClass}">
      ${url}
   </a>
`;}

Template calls

Template calls where parameters spawn multiple lines should be indented.

For example

Before

@template.foo.bar(
hello = "Hello",
world = "World"
)

After

@template.foo.bar(
   hello = "Hello",
   world = "World"
)