-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
Formatting of .vue files? #543
Comments
Did you install other vue extensions? Do you have |
I have this problem too in same vetur/vscode version, but my system is Windows10, vscode prompt "The Vue Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.". |
@octref I had Vue Snippets but I tried uninstalling it and it still doesn't work. I have no files.associations in my settings, just the default |
It solved itself by resintalling Vetur for some reason. |
As shown in the screenshoot below, I have the same problem. I have Vetur and Vim plugin installed, and file.associations that link *.wpy files to vue formate. When I press "==" to formate one line in a wpy file, a hint will shown up said: "Sorry, but there is no formatter for 'vue'-files installed." |
@Atuna We do not have line-based formatter. You can only format whole document. |
Hi, this should not be closed, it did not solve after a reinstall of vetur. This issue is related to the 1.18 version of VSCode. |
Running into this issue as well. I'm guessing this has to do with the change to Prettier. Does it need to be installed via NPM. I added the VSCode extensions now. |
@octref you say you never had line or selection based formatting, but I don't recall seeing this error before now. |
@Atuna is the only person giving me a screenshot, and the problem is Vetur registers a formatter for *.vue files, not *.wpy files. If you report issue without describing the issues, like which file you are trying to format, what extensions you have, etc, I can't do anything right? |
Hi @octref, this is not the lack of good will, it is that there are actually not much to say, this bug appear as soon as we try to format any
So there are no file associations. The bug appeared as soon as I updated to VSCode 1.18. I'll try to check if there is a bad interaction with another lib, but I think it is a config or lower level issue. |
I have 1.19.0-insider with the latest build, and the problem still exists. |
What's the output in Output (In the bottom panel, next to terminal) -> v-language-sever? |
@octref It shows |
Oh yeah sorry, it shows |
I'm tracking this in #592. |
I met this situation too! |
I have 1.19.1-insider with the latest build, and the problem still exists.I reinstalled,but it doesnot working now. |
@octref 、@eric-burel,please help me! |
@eric-burel Thanks! |
Add this to your settings: |
I have the below json in my settings. But still it is not formatting
|
also, I had to remove "Beautify" extension. now it's formatting all including HTML. |
|
Hello, i try the last solution and it works well but it conflicts with Eslint plugin:vue/recommended. How can we setup js-beautify-html to apply formats like : html.format.wrapAttributes : force-expand-multiline |
ok. I try this out. that format all the document what I'm trying to do is to format only html. and have another configuration for js. |
I added a notice on top of https://vuejs.github.io/vetur/formatting.html. |
Mine is fixed.
|
My setting. working for my.
|
@octref Could you please reopen this issue and leave open until there is an official default solution listed at |
Yes, there are other issues for prettier. Please find the right one to follow up: https://github.com/vuejs/vetur/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+prettier |
Solutions*Update!PrettyHTML now supported, see last solution 3 below 1. ESlint
|
Re prettyHTML, see #491 (comment), I'm looking into it, so far looks promising. |
@octref it looks great but difficult to figure out how to install in vscode today. I don’t have the skills unfortunately but a extension would be great. |
It is bundled. Just enable it with |
@octref i just try it like that and it doesn't work. my settings : |
From what I've gleamed it seems prettyhtml preserves spacing contextual to
the file. If you flatten all indentation, it'll space back out to 2 but if
it was initially spaces at 4 it'll respect that
…On Thu, 18 Oct 2018, 20:21 Sandro Das Neves, ***@***.***> wrote:
@octref <https://github.com/octref> i just try it like that and it
doesn't work. my settings :
[image: capture d ecran 2018-10-18 a 21 15 35]
<https://user-images.githubusercontent.com/17152022/47178276-036f3e80-d31b-11e8-8d3e-1d36fdd8bd96.png>
the template tag still with 2 spaces after saving should i format the
document manually ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#543 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABKc97fZ7TFW6qGNwdw9_lzi4fnuCmFTks5umNS3gaJpZM4QdRir>
.
|
@sandro-git @oller This is VS Code's feature called |
@octref sorry to boring you with that small problem but it still doesn't indent 4 spaces instead 2. |
Yup, I have the same issue. HTML formatted with 4 spaces, style/script with 2 spaces. All other JS files are 4 spaces. |
Same here, |
If you have a When they are present, they override the The original issue happens when you have not initialized Vetur correctly. If you still experience it, open new issues with repro steps. |
That makes no sense. This can be reproduced by having a clean install of vscode. Configure vscode to be tabsize 4. Turn off detect by file. Then install vetur. And it sets the tabsize 2. It ignores vscode. If installing vetur code says I did not initialize it correctly then vetur is buggy. (This is how my local is setup) |
I see your problem. I think going forward, having two options, Maybe I should also avoid reading configs from |
@octref what do you mean by initialized vetur correctly. I just install it, change some option and use it. |
@sandro-git So you are still experiencing the original problem? Try to either reinstall Vetur or remove other Vue extensions that would conflict with Vetur. |
you can check this |
Info
Problem
The editor says: "Sorry, but there is no formatter for 'vue'-files installed." when I press format document keybind.
Did I miss something or does Vetur with Prettier not support .vue files anymore for formatting?
The text was updated successfully, but these errors were encountered: