Highlighted

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

Explorer ,
Apr 03, 2020

Copy link to clipboard

Copied

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?

Topics

Code

Views

535

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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

Explorer ,
Apr 03, 2020

Copy link to clipboard

Copied

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?

Topics

Code

Views

536

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Apr 03, 2020

Copy link to clipboard

Copied

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

 

junk.png


Ben

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Apr 04, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Apr 04, 2020

Copy link to clipboard

Copied

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.

 

junk.png

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.


Ben

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...