The results of beautification are not what I expect.
This is what the code looked like before:
@isTest
private class MyTestClass {
@testSetup
static void createCommonData(){
(tab)Account a = newAccount();
(tab)insert a;
The beautified code should have looked like this:
@isTest
private class MyTestClass {
(tab)@testSetup
(tab)static void createCommonData(){
(tab)(tab)Account a = newAccount();
(tab)(tab)insert a;
The beautified code actually looked like this:
@isTest
private class MyTestClass {
(tab)(tab)@testSetup
(tab)(tab)static void createCommonData(){
(tab)(tab)(tab)(tab)Account a = newAccount();
(tab)(tab)(tab)(tab)insert a;
Atom Beautify: Beautify EditorHere is a link to the debug.md Gist: https://gist.github.com/anonymous/f1b5b9139d6337b588e53b83bb9945e5
I have:
debug.md Gist to this issueIf this is not a problem with Atom Beautify settings it is mostly like a problem from the beautifier, uncrustify. You might try opening an issue with uncrustify and linking it to this issue.
I am working on uncrustify.
Could you push an example source and the config file you use with?
@gmaurel Those should be available in https://gist.github.com/anonymous/f1b5b9139d6337b588e53b83bb9945e5
Just let us know if there is additional information we should be including.
Uncrustify does not support Apex as a language but Atom beautify thinks otherwise https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/uncrustify/index.coffee#L57.
From what I've read Apex is closer to Java and you could try to use that as language override (unless there are some Apex-isms that will break the parsing).
Thanks @mihaipopescu I will recommend some reconfigurations to Atom Beautify.
To confirm, should Apex be removed from Uncrustify beautifier support in Atom-Beautify or is there some configuration changes required to make it work?
I don't know anything about Apex language other than it's a Java dialect but where does it start to differ that I don't know.
should Apex be removed from Uncrustify beautifier support in Atom-Beautify or is there some configuration changes
I think that's entirely your call. Uncrustify supports Java and if that's ok with you I guess you can make some changes to the configs to use that language instead. Better have something than nothing.
Once https://github.com/Glavin001/atom-beautify/pull/1707 has been merged Apex will be treated as JAVA language for Uncrustify.
Published to v0.30.0
Most helpful comment
Thanks @mihaipopescu I will recommend some reconfigurations to Atom Beautify.