Visual Studio Code - How to show user snippets on top of other suggestions?
Asked Answered
Y

1

11

I have created a JavaScript 'user snippet' in the Visual Studio Code to make it slightly faster to call the console.log() method (a line of code that I write very frequently).

"Console Log": {
    "prefix": "log",
    "body": [
        "console.log($0);"
    ],
    "description": "JavaScript Console.log()"
}

The user snippet works, but when I type log into the editor, my custom snippet is at the bottom of the list.

'log' is at the bottom of the list

Is there any way I can make this the first suggestion, rather than the last?

Yellowish answered 8/5, 2017 at 15:57 Comment(0)
C
20

Try setting:

"editor.snippetSuggestions": "top"

enter image description here

Checkerbloom answered 8/5, 2017 at 16:0 Comment(2)
Perfect! That's exactly what I needed.Yellowish
This doesn't necessarily target user snippets - for example, I still have the VSCode default "log" snippet coming first before mineGuidotti

© 2022 - 2024 — McMap. All rights reserved.