[英]User Snippets for Svelte in VSCode
I struggle to create a simple snippet for.svelte files or Svelte project.我很难为 .svelte 文件或 Svelte 项目创建一个简单的片段。 Here's the procedure i've tried:
这是我尝试过的程序:
{
"test": {
"scope": "Svelte",
"prefix": "xx",
"body": ["This is a simple test"],
"description": "Code snippet for testing"
}
}
Any idea?任何想法?
The scope id for Svelte is probably svelte
lowercase. Svelte 的
svelte
id 可能是小写的。 If you click on the Svelte
language id button in the lower right when you have a .svelte
file open, you can look through those language ids for svelte
- the correct version to use is that in the parentheses like如果在打开
.svelte
文件时单击右下角的Svelte
语言 ID 按钮,则可以查看svelte
的这些语言 ID - 要使用的正确版本是括号中的版本,例如
Svelte (svelte)
use the version in parentheses - svelte
lowercased Svelte (svelte)
使用括号中的版本 - svelte
小写
You do not need to remove the scope selector but it is redundant if it is already inside the svelte.json
file which limits all snippets within it to that filetype.您不需要删除 scope 选择器,但如果它已经在
svelte.json
文件中,则它是多余的,它将其中的所有片段限制为该文件类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.