Visual Studio Code 用户片段不起作用

问题描述:

我在 VS Code 中启用了默认的日志"片段.我还添加了另一个片段.当我输入它们的前缀时,它们都不显示.我已将 editor.tabCompletion 设置为 true.

I've enabled the default "log" snippet in VS Code. I also added another snippet. Neither show up when I type their prefixes. I have set editor.tabCompletion to true.

知道为什么这些不起作用吗?

Any idea why these don't work?

有几种方法可以解决这个问题.问题是 Intellisense 妨碍或默认将您的片段放在列表底部.

There are a couple of ways you can fix this problem. The problem is Intellisense is getting in the way or default putting your snippets at the bottom of the list.

首先我尝试了建议延迟,但后来我决定让 Intellisense 使用 snippetSuggestions 用户首选项将我的片段放在建议列表的顶部:

First I played with the suggestion delay, but then I settled on having Intellisense put my snippets in the top of the list of suggestions with the snippetSuggestions user preference:

{
  "editor.tabCompletion": true,
  "editor.snippetSuggestions": "top"
}