Vetur: Emmet: Wrap with abbreviation not working

Created on 27 Dec 2017  路  16Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: Linux, Manjaro 17
  • Vetur version: 0.11.5
  • VS Code version: 1.19.1

Problem

vokoscreen-2017-12-27_13-59-57

Reproducible Case

select code, click f1, select emmet: wrap with abbreviation

Not working only vue files. Stop working from 1.8 vs code.

bug emmet

Most helpful comment

You need to configure emmet to treat vue file as html. Paste these into vscode settings.

    "emmet.includeLanguages": {
        "vue-html": "html",
        "vue": "html"

    }

All 16 comments

I can confirm it's not working in .vue files for me either (works in plain HTML files though):

  • Platform: Windows 10
  • VS Code version: 1.19.1
  • Vetur version: 0.11.5

You need to configure emmet to treat vue file as html. Paste these into vscode settings.

    "emmet.includeLanguages": {
        "vue-html": "html",
        "vue": "html"

    }

@HerringtonDarkholme, nope it's worked bad.
If i set

  "emmet.includeLanguages": {
        "vue-html": "html",
        "vue": "html"

    }

I'm start get suggest in script block. Previous version, i get suggest only in template block if i set settings like this

  "emmet.includeLanguages": {
        "vue-html": "html"
    }

Sadly wrapping with abbreviation is a feature coming from vscode itself. The code locates at emmet extension, not in vetur. I suggest you open an issue in vscode repo.

@HerringtonDarkholme Thanks. The solution you provided is good enough for me.

In my config the properties in emmet.includeLanguages were arrays, which seems to have stopped it from working. Must have been a change in emmet code in vs code. Working now with configuration from above.

Also have this issue, code("vue": "html") helps, but it also enable html emmet completions in style and script sections what is bad, seems like "vue-html": "html" (without "vue": "html") is broken for some reason...

thanx @HerringtonDarkholme.
I was going crazy with jsp files also.
didnt work didint work didnt got a answer until here

As of today you shouldn't need any emmet config for the emmet features to work.

Nothing changed since my last post, emmet "Wrap with Abbreviation" not working... Latest update.

@Nejik You should open an issue at VS Code side.

@octref trouble only with vetur, all other dialects and other file types works fine

@Nejik OK will take a look.

You need to configure emmet to treat vue file as html. Paste these into vscode settings.

    "emmet.includeLanguages": {
        "vue-html": "html",
        "vue": "html"

    }

Works perfectly for me, thanks!

As others have mentioned, you can now wrap code within the script and style sections as well, but I don't really see an issue with that. Nothing is making you wrap code in cases where it doesn't make sense.

seems fixed with new vscode update https://code.visualstudio.com/updates/v1_28#_emmet
The Emmet: Wrap with Abbreviation feature is no longer restricted to files with the .html extension.

Ok, seems they solved the upstream issue. Now you should be able to use it without adding the includedLanguages.

Was this page helpful?
0 / 5 - 0 ratings