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

Incorrect indentation when a comment line is placed right after a line without semicolon (JS Beautify) #494

Closed
seoker opened this issue Aug 4, 2015 · 6 comments

Comments

@seoker
Copy link

seoker commented Aug 4, 2015

If I have a line marked as comment under a normal statement without semicolon, like this
image
atom-beautify turns them to be
image

I'm wondering if this is a limitation or bug?

PS. For my team's coding convention, we don't use semicolon at the end of statements.

@Glavin001
Copy link
Owner

Could you run Atom command in command palette: Atom Beautify: Help Debug Editor, the put the contents into a Gist with a markdown file (extension .md) and paste the link here. Thanks,

@Glavin001 Glavin001 added this to the v0.29.0 milestone Aug 4, 2015
@seoker
Copy link
Author

seoker commented Aug 5, 2015

Hi, I create a sample that shows this problem, not my original file.
Here is the link: https://gist.github.com/seoker/7e023d42715417c4811c

@seoker seoker changed the title Incorrect indent when a comment line is placed right after a line without semicolon Incorrect indentation when a comment line is placed right after a line without semicolon Aug 5, 2015
@prettydiff
Copy link
Collaborator

This looks like a Pretty Diff bug.

@seoker
Copy link
Author

seoker commented Aug 24, 2015

I'm using JS Beautify as default JS beautifier, not prettydiff, and the result is different from pretty diff.
image

original code:
image

JS beautify:
image

prettydiff:
image

@seoker seoker changed the title Incorrect indentation when a comment line is placed right after a line without semicolon Incorrect indentation when a comment line is placed right after a line without semicolon (JS Beautify) Aug 24, 2015
@Glavin001
Copy link
Owner

If the beautifier is set to JS Beautify I recommend forwarding this issue over to them at https://github.com/beautify-web/js-beautify
When you create the issue there please link back to this issue so we can see if it is closed.

Also it looks like @prettydiff implemented the fix in Pretty Diff beautifier: prettydiff/prettydiff#138
So you could switch from JS Beautify to Pretty Diff for your Default Beautifier.

@prettydiff
Copy link
Collaborator

This issue is 2 years old. I am closing this issue as it is likely resolved. If the defect remains present please reopen this issue.

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

3 participants