Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Engaged ,
Apr 03, 2020 Apr 03, 2020

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
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 03, 2020 Apr 03, 2020

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

 

junk.png

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 04, 2020 Apr 04, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2020 Apr 04, 2020
LATEST

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.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines