最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Visual Studio Code - How to show user snippets on top of other suggestions? - Stack Overflow

programmeradmin4浏览0评论

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.

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

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.

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

Share Improve this question edited Feb 13, 2022 at 17:56 ikonuk 65210 silver badges22 bronze badges asked May 8, 2017 at 15:57 Adam McKennaAdam McKenna 2,4456 gold badges33 silver badges42 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 20

Try setting:

"editor.snippetSuggestions": "top"

发布评论

评论列表(0)

  1. 暂无评论