Vetur: Vue user snippet not working with vscode 1.24.0 vetur 0.12.5

Created on 8 Jun 2018  路  2Comments  路  Source: vuejs/vetur

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

Info

  • Platform: macOS
  • Vetur version: 0.12.5
  • VS Code version: 1.24.0

Problem

Only output from Panel -> Output -> Vue Language Serve is

Vetur initialized

I have a vue.json user snippet with the following content:

{
    "Print to console": {
        "prefix": "conso",
        "body": [
            "console.log('DEBUG: value of ${1:varname}: ' + ${2|var,JSON.stringify(var)|})",
        ],
        "description": "Log output to console"
    }
}

It has been working with Vetur + VSCode 1.23.0 and prior, and only stopped working when I upgrade to VSCode 1.24.0

To be sure that the user snippet is actually working, this is what I did:

  1. Disable Vetur
  2. Enable the extension Vue https://github.com/LiuJi-Jim/vscode-vue.git
  3. Reload VSCode
  4. User snippet is working. See the screenshots below

image
image

I also went ahead and

  1. Renamed the snippet shortcut from conso to debug
  2. Tested to make sure it is working with Vue extension
  3. Disable Vue extension
  4. Re-enable the Vetur extension
  5. Test again by typing debug in a Vue source file, and it does not work

I also have the following in my VSCode user settings:

    "editor.snippetSuggestions": "top",
    "editor.tabCompletion": true
question

Most helpful comment

I don't think that's ever supposed to work. In the <script> section only JavaScript snippets will be available. You should move that snippet to the JS snippet definition file.

All 2 comments

I don't think that's ever supposed to work. In the <script> section only JavaScript snippets will be available. You should move that snippet to the JS snippet definition file.

Was this page helpful?
0 / 5 - 0 ratings