3

Problem

The automatic indents in .vm files don't behave as I want them to. Below I add the auto formatted file and also the formatting I want.

The following code snippet is auto formatted by IntelliJ:

#styleTitle('sample-title')

#@styleDescription()
A short description of the component
#end


#@styleComponent('/components/molecules/sampleComponent/sampleComponent', {
    "headline": 'A headline title',
    "alertText": "Alert text example",
    "link" : {
    "href": "www.stackoverflow.com",
    "text": "Click here!"
}
})#end

What I want:

#styleTitle('sample-title')

#@styleDescription()
    A short description of the component
#end


#@styleComponent('/components/molecules/sampleComponent/sampleComponent', {
    "headline": 'A headline title',
    "alertText": "Alert text example",
    "link" : {
        "href": "www.stackoverflow.com",
        "text": "Click here!"
    }
})#end

Question

I couldn't find any additional configuration under IntelliJ IDEA | Preferences | Editor | Code Style | Velocity to adjust indention for different code blocks.

How can I configure the code style manually for a specific file type in IntelliJ and how does such a configuration file look like?

Shayan Sh
  • 93
  • 2
  • 4
  • Currently it's not possible. Feel free to create feature request on YouTrack: https://youtrack.jetbrains.com/issues/IDEA – y.bedrov Jul 20 '21 at 17:08
  • Here I created an issue for it on YouTrack. Hopefully it won't get closed without a solution like its former issues: 1. https://youtrack.jetbrains.com/issue/IDEA-224925 2. https://youtrack.jetbrains.com/issue/IDEA-55660 – Shayan Sh Jul 24 '21 at 20:52
  • here is the issue I reported: https://youtrack.jetbrains.com/issue/IDEA-274354 – Shayan Sh Jul 26 '21 at 07:00

0 Answers0