-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Depend on js-beautify directly #82
Comments
Will use https://github.com/mrmlnc/vscode-pugbeautify for jade/pug. |
wonderful~! waiting for the new version~~ |
Formatters are temporarily disabled until this feature is addressed. |
Looking forward to the new version.. |
I really need the formatter too !~~~~ |
+1 |
@octref Couldn't you just disable the formatter per default and make it accessible per workspace settings? I don't think that the added new lines are such a big problem. Maybe just add it as "experimental" feature. |
It was working fine for basic setups, wasn't it? Would like to see it enabled back. |
This is top on my list. Give me a day or two to work on it. |
Stole these config from https://github.com/victorporof/Sublime-HTMLPrettify const htmlOptions = {
brace_style: 'collapse', // [collapse|expand|end-expand|none] Put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are
end_with_newline: false, // End output with newline
indent_char: ' ', // Indentation character
indent_handlebars: false, // e.g. {{#foo}}, {{/foo}}
indent_inner_html: false, // Indent <head> and <body> sections
indent_scripts: 'keep', // [keep|separate|normal]
indent_size: 2, // Indentation size
max_preserve_newlines: 0, // Maximum number of line breaks to be preserved in one chunk (0 disables)
preserve_newlines: true, // Whether existing line breaks before elements should be preserved (only works before elements, not inside tags or for text)
unformatted: ['a', 'span', 'img', 'code', 'pre', 'sub', 'sup', 'em', 'strong', 'b', 'i', 'u', 'strike', 'big', 'small', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], // List of tags that should not be reformatted
wrap_line_length: 0 // Lines should wrap at next opportunity after this number of characters (0 disables)
};
const cssOptions = {
end_with_newline: false, // End output with newline
indent_char: ' ', // Indentation character
indent_size: 2, // Indentation size
newline_between_rules: true, // Add a new line after every css rule
selector_separator: ' ',
selector_separator_newline: true // Separate selectors with newline or not (e.g. 'a,\nbr' or 'a, br')
}; These will be used as initial default, let me know what you agree & don't agree with. (Indentation size & char is read from VSCode config). |
Check out 0.5.3 and let me know how it works. Still yet to be done:
|
0.5.4 preserves new lines for html, and uses Seems css/scss/less preserve new lines option is being added this weekend, beautifier/js-beautify#1146 I'll add it once it lands in |
v0.5.4 is wonderful :) |
@danikane Will do soon. |
@danikane This is already in master so closing. Also |
Many thanks! |
@octref Any news on status of pugbeautify integration? |
@octref Amazing! Thx! :-) |
vscode-html-languageservice
depends onjs-beautify
directly. However, it's not aware of scss, less regions. It's also causing problems like #77.js-beautify
actually supports scss and less, so vetur will just depend on it directly.Overall:
"vetur.vue-html.format.config": ".htmlbeautifyrc"
"vetur.css.format.config": ".cssbeautifyrc"
"vetur.js.format.config": ".jsbeautifyrc"
The text was updated successfully, but these errors were encountered: