Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding extra indentation in Apex code #1361

Closed
5 tasks done
fricco opened this issue Nov 16, 2016 · 9 comments
Closed
5 tasks done

Adding extra indentation in Apex code #1361

fricco opened this issue Nov 16, 2016 · 9 comments

Comments

@fricco
Copy link

fricco commented Nov 16, 2016

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;

Actual Output

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;

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

Debug

Here is a link to the debug.md Gist: https://gist.github.com/anonymous/f1b5b9139d6337b588e53b83bb9945e5

Checklist

I have:

  • Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • Reloaded (or restarted) Atom to ensure it is not a caching issue
  • Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • Generated debugging information and added link for debug.md Gist to this issue
@prettydiff
Copy link
Collaborator

If 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.

@gmaurel
Copy link

gmaurel commented Nov 22, 2016

I am working on uncrustify.
Could you push an example source and the config file you use with?

@prettydiff
Copy link
Collaborator

@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.

@mihaipopescu
Copy link

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).

@prettydiff
Copy link
Collaborator

Thanks @mihaipopescu I will recommend some reconfigurations to Atom Beautify.

@Glavin001
Copy link
Owner

To confirm, should Apex be removed from Uncrustify beautifier support in Atom-Beautify or is there some configuration changes required to make it work?

@mihaipopescu
Copy link

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.

@Glavin001 Glavin001 self-assigned this Jun 16, 2017
@Glavin001
Copy link
Owner

Glavin001 commented Jun 16, 2017

Once #1707 has been merged Apex will be treated as JAVA language for Uncrustify.

@Glavin001
Copy link
Owner

Published to v0.30.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants