-
Notifications
You must be signed in to change notification settings - Fork 453
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
JS Chained methods never break regardless of "Break Chained Method" setting #836
Comments
Please follow the Issue template provided, it is required not a recommendation. For your convience, here it is again: https://github.com/Glavin001/atom-beautify/blob/master/ISSUE_TEMPLATE.md I await your debugging information. Thank you. Possibly related issues: #831, #830 |
I uninstalled Atom-Beautify and reinstalled, I also deleted the Atom-beautify section from my config.cson file. Here is the debug.md: https://gist.github.com/ProustIdee/d0eb29920a3addc00409 |
The option you used is:
Which is language namespace While the language namespace for your code is So Atom Beautify filtered out the options only for I do not see the I'd recommend setting Something like: {
"html": { "break_chained_methods": true }
} |
Thanks for the reply. Is there a reason this worked until recently? The way that I understand it, I should have separate js files and call them from the html file, rather than writing script in the <script> </script> tags in the html file. However, I didn't have any problems with this until recently, everything worked perfectly. |
So you had a single HTML file with JavaScript content and using the |
Updates published to npm for dependencies, such as Pretty Diff or JS-Beautify, are not automatically applied to Atom Beautify in Atom, nor is Atom Beautify even shown as needing an update. However the dependency versions required for dependencies are very loose within Atom Beautify, such that by reinstalling Atom Beautify you can effectively update to the latest version of all the dependencies. For example, Pretty Diff: So when you updated Atom Beautify, which has not happened in a while, you likely did update Pretty Diff and those changes made 13 days ago. @prettydiff this may be an issue on your end then. Let me know if there's anything I can help with. |
Looking at this now. When I run the sample code against the I am examining this operation in Atom now. |
I think I found the problem in Atom. You can reproduce the problem if Pretty Diff is the beautifier for both HTML and JavaScript. I think this problem is this following line where Pretty Diff is being passed a boolean for its
I am verifying now and also looking to see when/why this was changed on the Pretty Diff side. |
Disregard the previous comment. I appear to be handling boolean values for that option correctly for backwards compatibility. That is not the problem. The problem is that the language grammar is HTML. When I isolate the JavaScript code and change the language grammar to JavaScript everything work as expected. For some reason the option is not being passed through from HTML to JavaScript in Atom Beautify. I am looking to where this gets dropped. |
I am not sure how to resolve this. I think the error is the settings screen for Atom Beautify (though I have not confirmed this and dont know how). You can set a value for a JavaScript option on that page, and once that option is set the value is cached for that given language grammar. HTML, a different language grammar with a different set of options, sets and applies its options independently. When the current language grammar is HTML you can change JavaScript options to no effect. When you change the language grammar to JavaScript the change in effect is manifest. I have confirmed that the option setting works correctly if the language grammar is JavaScript. I have also confirmed that whatever setting was chosen for the given option is "locked in" once you change your grammar back to HTML. So long as the grammar is HTML the only thing that is broken is the JavaScript language option on the settings screen. |
I had the same problem...I had to change the file type in Atom to "JavaScript" as it was set to "Babel ES6 Javascript" |
The solution proposed by @timothyerwin makes me happy. The crux of the problem is that this JavaScript option needs to be exposed for HTML grammars. |
This issue is likely resolved as the latest version of Pretty Diff recently landed in Atom Beautify. If I am in error please reopen this issue. |
@prettydiff the updates have been published to apm yet, so you won't see changes yet. Should be soon though |
@szeck87 I am aware. Closing all these issues might be a bit premature for the users, but I still feel good about cleaning house and clearing out some of the backlog. Excellent work on that pull request by the way! |
Disabling 'Break chained methods' in Javascript settings didn't work for me. I had to disable it in JSX settings. |
With Atom-Beautify 0.28.24.
Input
code:Result of Beautifying:
It doesn't matter what I set "Javascript - Break chained methods" to. I'm using the JS Beautify engine.
I didn't have this problem until the last day or two. I assume Atom-Beautify was updated recently?
The text was updated successfully, but these errors were encountered: