Skip to main content
KlausKi
Inspiring
April 3, 2020
Question

How can I set JSON/JavaScript/TypeScript files formatting to have opening braces put on new line?

  • April 3, 2020
  • 1 reply
  • 1334 views

I'm used to read C style code (i.e. JSON/JavaScript/TypeScript) having the opening braces put on a new line. So, I'd like to set this formatting style in Dreamweaver for having it use that style of formatting when it auto-formats code.

 

How can I do that?

This topic has been closed for replies.

1 reply

BenPleysier
Community Expert
Community Expert
April 4, 2020

Have you tried creating your own set of rules? Go to Preferences > Code Format > Tag Library Editor

 

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
KlausKi
KlausKiAuthor
Inspiring
April 4, 2020

I don't get it ... Would you mind elaborating?

What exactly would I need to do in the Tag Editor to have opening braces always start on a new line?

BenPleysier
Community Expert
Community Expert
April 4, 2020

I apologise, the tag library does nothing for what you want. 

 

Which brings me to the fact that I do not quite get what it is that you want. When I create a so-called C style code, I have no problem with the way that braces are handled.

 

The moment that I enter the first brace, the cursor sits between the opening and closing tag. Clicking on Enter, the next line is indented ready for the next bit of code. The above sample was done using Dreamweaver, normally I use another editor with the exact same outcome.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!