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

Unexpected newline in compound expression with inline SOQL #40

Closed
boxfoot opened this issue May 17, 2019 · 3 comments
Closed

Unexpected newline in compound expression with inline SOQL #40

boxfoot opened this issue May 17, 2019 · 3 comments

Comments

@boxfoot
Copy link

boxfoot commented May 17, 2019

I'm honestly not sure what I expect the formatting to be here, but the hanging 0 at the end is really odd.

// input:
Boolean hasPrivateReports = (Integer) ([
	SELECT COUNT(Id) num
	FROM Report
	WHERE OwnerId = :UserInfo.getUserId()
]).get(0).get('num') > 0;

// current output - see newline at end
Boolean hasPrivateReports = (Integer) ([
	SELECT COUNT(Id) num
	FROM Report
	WHERE OwnerId = :UserInfo.getUserId()
]).get(0).get('num') > 
0;
@dangmai
Copy link
Owner

dangmai commented May 17, 2019

That's very interesting. I agree that the output does look odd, but it might not be an easy fix. Let me see what I can do.

Also, FYI we have a Gitter channel now at https://gitter.im/prettier-plugin-apex/community, if you have time you should stop by - I'm usually pretty responsive over there and can tell you which formatting choice is intentional and which one is a bug.

@dangmai
Copy link
Owner

dangmai commented May 23, 2019

I have fixed this in master, it will be available in the next release some time this or next week.

Thanks again for the report!

@dangmai
Copy link
Owner

dangmai commented Jun 3, 2019

FYI I have released the new version that contains the fix for this.

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

No branches or pull requests

2 participants