Skip to content
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

VSCode Emmet doesn't work with Vue (but works with .css or .scss files) #5749

Closed
onurusluca opened this issue Apr 19, 2022 · 1 comment
Closed

Comments

@onurusluca
Copy link

onurusluca commented Apr 19, 2022

Version

3.2.33

Reproduction link

github.com

Steps to reproduce

Create a standart Vue project from: https://vuejs.org/guide/quick-start.html#with-build-tools
Settings or versions don't matter.
Open the project with VSCode latest(v1.66.1)
Edit the CSS(between style tags) of .vue file.

What is expected?

Writing "ml10px" should give "margin-left: 10px;" but it doesn't.
Or "fdc" should give "flex-direction: center;"

What is actually happening?

Emmet abbreviation auto complete isn't working for CSS in a Vue(2 and 3 both).


Hi everyone! I am not sure if this is a problem of Vue but just wanted to ask.

Emmet abbreviation auto complete for CSS isn't working for CSS in a Vue(2 and 3 both) isn't working for me.
For example: ml10px should give 'margin-left: 10px;' but it doesn't.

Emmet works fine with css or scss by itself(in a .css or .scss file) but in a .vue file it doesn't.
I think this is a Volar problem as VsCode doesn't understand .vue files style. Here is the discussion: vuejs/language-tools#1211

Even though I hated it and knew it wasn't gonna work, I deleted Vscode, all it's settings etc. Reinstalled and tried without any plugins etc, still doesn't work.

This problem persist with Vue 2 or Vue 3.

I have tried VsCode emmet settings too, like emmet.triggerExpansionOnTab , emmet.includeLanguages
I have tried everything mentioned here

@onurusluca
Copy link
Author

onurusluca commented Apr 19, 2022

Just confirmed. It is a Volar problem. With Vetur it is fine. Volar is becoming default though. Hope this will be fixed soon. I looked at the code. I will try to fix and request a pull.

Update
FIX :For now anyone with the same problem:

  • Add these to your VSCode settings.json:
  • Restart all VsCode instances.
  "emmet.includeLanguages": {
   "vue-html": "html",
   "vue": "html"
    }

I had "vue-html": "html" but it is not enough, had to add both.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant