-
-
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
Format document doesn't format #692
Comments
We only have a formatter for the whole document. So you can't select a part of the document and format. HTML formatter is disabled by default. See: https://vuejs.github.io/vetur/formatting.html |
You need to put them this way:
|
Should the documentation make this clear? |
Here is the doc for changing settings: https://code.visualstudio.com/docs/getstarted/settings |
Sorry, what I meant is that going from the example on https://vuejs.github.io/vetur/formatting.html , it is not obvious that you need to decompose the default configuration into single line entries, at least for someone coming onto vetur for the first time. |
I updated the doc: https://vuejs.github.io/vetur/formatting.html |
@octref and then how can I configure the format settings for prettier css to indent 4 spaces |
@octref I have the same issue as @Dacredible Vetur formats my scss code to 2 spaces, while I would like to have four spaces (html and javascript, both indent to 4) |
For the default formatters, which are prettier for scss and javascript. For html, you can set
With js-beautify options. |
Info
Problem
Inside a
.vue
file, context-clicking and selecting 'format document' has no effect. Have tried selecting the code in a<template>
or<script>
block and that doesn't help either.The only work around is to create a temp.js and temp.html file, paste in the code from the appropriate code blocks and then format there, and the copy/paste the code back into the
.vue
file. Very time consuming and usually leads to formatting not being done by our programmers :(Reproducible Case
Any single file
.vue
file withtemplate
andscript
blocks. For example (bad formatting intended):The text was updated successfully, but these errors were encountered: