-
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
Remove unformatted
defaults as per bug fix released in js-beautify 1.8.0.
#2210
Comments
Please follow the issue template provided. More specifically, update the original comment for this issue by adding a link to the required debug.md gist which includes debugging information that answers our most commonly asked questions. Thank you. |
Sufficient information is provided in the description. There is no need for a debug.md gist. |
Sorry about that, the Unfortunately, removing default values for options has already been investigated and determined to not be feasible within Atom: #894 (comment) The applicable code for the default options can be found at atom-beautify/src/options.json Lines 365 to 433 in bb9428a
However, I am not necessarily in favour of making a breaking change -- updating the defaults -- as it is recommended to users of Atom-Beautify to explicitly override with their own option values and note again the default options are only there to appease Atom's Settings View schema validation. Atom-Beautify is not trying to be the best and single source of truth for default options. Atom-Beautify is trying to allow users the freedom to change these options in a similar way with a single package.
I only have a few moments right now -- however, I wanted to reply ASAP -- so I have yet to review js-beautify's issue fully. At first glance, it sounds like a new The default values are not something I want to maintain and only a necessary evil, as mentioned above and demonstrated in #894 (comment) . Given we cannot simply remove the default values and also doing so would be an unexpected breaking change for some, I would not approve a Pull Request implementing such a change without further consideration. I'll try to review |
@garretwilson @Glavin001 |
Yes, but (and this is important!) you much change the defaults of Let me make it simple: Then why did we put This bug has (finally!!!!!!) been fixed. The inline elements are now in
There is no reason to keep Even worse, if users don't know to put Please, please set the default of |
Let me give an example, assuming that line-wrapping is turned off: <p>This is a <a
href="http://example.com/">link</a> to a site.</p> Does that need formatting? Yes, of course. It should look like this: <p>This is a <a href="http://example.com/">link</a> to a site.</p> Can you find one single person who says that The reason we had <p>This is a
<a href="http://example.com/">link</a>
to a site.
</p> And so to work around the bug we chose the lesser of two evils and decided to tell js-beautify not to format That bug has been fixed. We can now say, "Format |
In order to show that I don't merely want to complain, but that I do want to contribute, I've posted a USD$50 bounty for this ticket. I think @bitwiseman has already submitted a pull request; that's fine—he certainly deserves it for going out of his way to update another library that depends on his. Here is the bounty for whoever completes this task: I'm so anxious to get this fixed and I'll be overjoyed when it's in. Thank you in advance. |
@garretwilson FYI, you (and any other user) can get the behavior you want by setting unformatted to empty right now. Since atom-beautify doesn't currently set |
As if I didn't have enough to complain about: I just now uninstalled
(grumble grumple) Now I'm in a pickle. Maybe it's because today I upgraded Node to v10.9.0. Whatever the case, Node won't let me downgrade. Any ideas? Now I don't even have any formatting plugin in Atom. |
Nope, I uninstalled Node and reinstalled v9.5.0 I get the same error trying to install |
Apparently it's a known problem: https://discuss.atom.io/t/installing-atom-beautify-0-33-0-failed/58383 I don't want to hijack this thread, but frankly I'm just too tired today to file yet another |
Installing |
So it's already reported in #2213 , and the stupid bot keeps closing that ticket. It seems many of us are in a pickle. |
Following this tip I temporarily created a symbolic link to marko 4.13.4 to make it think it was marko 4.13.3, and at least got |
@garretwilson I published a new version of Atom Beautify yesterday that resolved the installation issue. But for the purposes of developing atom beautify, you'll need to clone it locally and symlink it to Atom itself anyways. |
Good news! In beautifier/js-beautify#1033 we finally succeeded in getting a long-standing js-beatify bug fixed. Specifically js-beautify was mis-using the
unformatted
setting to indicate whether elements were inline or not. Without this set, inline elements such as<mark>
would be broken into multiple lines. But with it set, js-beautify would not format these elements at all (e.g. it would not remove line breaks between attributes).This fix how now available in js-beautify 1.8.0: https://github.com/beautify-web/js-beautify/releases/tag/v1.8.0
The solution was to make a new
inline
setting that the formatter really considers to be inline—that is, they are formatted, just not broken. All the inline elements formerly inunformatted
were moved toinline
. Theunformatted
was left, just in case someone still wants to add an element that really is not formatted at all, but it is set to empty. See beautifier/js-beautify#1407 .Unfortunately atom-beautify sets its own default values for
unformatted
, so they will need to be removed or they will override these changes (essentially un-fixing the fix for beautifier/js-beautify#1033 ).I think the real solution here is to remove the atom-beautify explicit values altogether, as I recommended in #1008 (comment) . js-beautify has its own defaults. They have been changed multiple times, and if atom-beautify duplicates those defaults explicitly, atom-beautify will have to be playing catch-up with manual modifications each time. I think atom-beautify should allow anything to be overridden, but has no need to specify explicitly what atom-beautify is providing as defaults anyway.
In any case, atom-beautify needs to remove the explicit
unformatted
values set in #1008 whenever atom-beautify updates to js-beautify v1.8.0.Thanks!
The text was updated successfully, but these errors were encountered: