Robert Cemper · Feb 1, 2018

Beautifying for Object Script ?

This a spin of from For and If with one line: to brace or not to brace
Has anyone seen or heard of a Beautifier for Object Script?

There is a bunch of them out for XML, HTML, JavaScript, CSS, PHP,  ....

What I think of is a utility / package that is able to

  • #1 format your source code by appropriate Tabs/Spaces
  • #2 (more important) - to replace legacy notation with bracket notation - to wrap all kind of (post-)conditions in JavaScript style

I'ts definitely a tricky thing.
And I never head of any attempt to do it. 

A simple example:

IF a=2 set b=2
ELSE  set b=0

might  become 

set $TEST= (a=2)
IF ($TEST) { set b=2 }
ELSE {set b=0 }

to move to brackets and maintain $TEST correctly

Also covering all the other strange things you know all

0 1,088
Discussion (8)1
Log in or sign up to continue

Would be good if we get this for Object Script. May be better to understand how Atelier editor does format the code.

That looks very interesting.
Leaving the decision what change to apply to the developer is well acceptable.

 Syntax Checker is probably more important!
And at a first glance it seems well suited to also control progress and impovement!


Unfortunately, it is not so easy to implement it without a good parser. InterSystems still don't want to publish any sort of parsers. And not sure they have plans to implement it in Atelier, yet. While we still have so many troubles in Atelier, it would be better if they will fix it first. And then it would be possible to ask, hope it will not take so long.

In your case, it is not only beautifier it is also static syntax check. Which can recommend changing some bad practices/old school/possible error code. And it is done by project CacheQuality

Oops !  where ?? how ??
do you refer to Edit / Advanced ?