Visual Studio Code 用户片段不起作用 [英] Visual Studio Code user snippets not working

查看:60
本文介绍了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"
}

这篇关于Visual Studio Code 用户片段不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆