-
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
Support reserved words as property names #71
Comments
Thank you for making this issue and doing your research and finding that js-beautify issue. |
@StevenACoffman I am unable to reproduce this issue. Could you please try again with the latest |
Let me know if this is still an issue and how you can reproduce it -- what is your configured options, etc -- and I can reopen this issue. |
I am using Atom 0.125.0 with Atom-Beautify 0.2.4. This code below is an example of the problem behavior: var Promise = require('bluebird');
function synchronousPromise() {
Promise.resolve(console.log('hello'))
.then(console.log('how are you'))
.then(console.log('goodbye'))
.catch(console.log('error occurred'));
} The beautifier will reformat the .catch as: var Promise = require('bluebird');
function synchronousPromise() {
Promise.resolve(console.log('hello'))
.then(console.log('how are you'))
.then(console.log('goodbye'))
.
catch (console.log('error'));
} This does not happen when I got to jsbeautifier.org and paste in the code there. |
We are currently at version |
On an unrelated note, I would like to refer you to the GitHub Flavoured Markdown cheat-sheet, where you can learn about how to make your comments easier to read with markdown styling: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet Specifically the section for Code blocks: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code 😃 |
In atom, when I went to preferences -> packages, Atom-Beautify did not show up as having available updates. This may be another problem. Uncaught TypeError: Cannot read property of 'messagePanel' of undefined. |
Thank you. On it right now. |
I have unlinked my development directory and installed the latest |
Atom Beautify 0.7.0 I restarted Atom (does that count as reloading Atom Beautify?). When I turned both "Beautify on Save" and "Beautify Entire File On Save" off, I don't get the error even when I manually Beutify. When I turn them both on, I do get the error on Save. |
Thanks for helping. When I have "Beautify On Save" off, but "Beautify Entire File On Save" on, and save the file, I do not get the error when I save the file. |
This is my root directory .jsbeautifyrc {
"html": {
"brace_style": "collapse",
"indent_char": " ",
"indent_scripts": "normal",
"indent_size": 6,
"max_preserve_newlines": 1,
"preserve_newlines": true,
"unformatted": ["a", "sub", "sup", "b", "i", "u"],
"wrap_line_length": 0
},
"css": {
"indent_char": " ",
"indent_size": 4
},
"js": {
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 4,
"jslint_happy": true,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_in_paren": false,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"e4x": false,
"wrap_line_length": 120,
"indent_size": 2,
"indent_char": " ",
"indent_level": 0
},
"sql": {
"indent_size": 4,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false
}
} |
Thanks! That is why I do not receive that error. I do not have |
Thank you for bearing with me. Should I pursue the fact that Atom did not mark package Atom-Beautify 0.2.4 as having available updates, or is that an old and resolved issue? Other packages had been marked as having available updates, and I had successfully updated them on a weekly basis. |
The lack of update notification may be an issue with apm renaming package, however I am not really sure of the implementation and if that could be the case. Atom Beautify was migrated (probably around v0.2.4) from the original creator to myself as the current maintainer. I had to drive from work to school. Now I am back on the case! I have found where the issue is and am working on a patch. |
@StevenACoffman I have patched #81. Please update to v0.7.1 and let's continue with this issue :). |
I can confirm both this that it is fixed and that you are my hero. Thanks for being so supportive and running all this stuff down. |
Excellent! You're very welcome. I am glad to hear everything is working as expected. Let me know if you have any further questions or problems. |
I'm using Q and some of its methods are reserved words, like catch and finally.
In Q for example you can write:
But this is formatted by atom-beautifier in:
Because catch is interpreted as a keyword.
Is there a way to format this code properly without using the square bracket notation (i.e. Q($.ajax(...))'catch')?
This issue appears to have been resolved in js beautify:
beautifier/js-beautify#439
I'm not sure if atom-beautifier uses the same implementation.
Thanks!
The text was updated successfully, but these errors were encountered: