Visual studio code 使用用户定义的代码段覆盖VS代码段
我已经在VisualStudio代码中配置了以下类型脚本片段Visual studio code 使用用户定义的代码段覆盖VS代码段,visual-studio-code,Visual Studio Code,我已经在VisualStudio代码中配置了以下类型脚本片段 "console.log": { "prefix": "cl", "body": [ "console.log();" ], "description": "console.log()" } 但是它不起作用,因为已经为cl(类)定义了一个代码段。我怎样才能用我的代码覆盖那个片段?我想使用cl,因为我有其他IDE也是以同样的方式配置的,我不
"console.log": {
"prefix": "cl",
"body": [
"console.log();"
],
"description": "console.log()"
}
但是它不起作用,因为已经为
cl
(类)定义了一个代码段。我怎样才能用我的代码覆盖那个片段?我想使用cl
,因为我有其他IDE也是以同样的方式配置的,我不想改变我的惯例。当您键入cl
时,会显示cl代码段所有可能扩展的列表,您的代码段可能位于列表的底部。为了访问列表顶部的代码段,您可以将以下内容添加到设置.json
// Place your settings in this file to overwrite the default settings
{
"typescript.useCodeSnippetsOnMethodSuggest": true,
"editor.snippetSuggestions": "top",
"editor.tabCompletion": true
}
这里请注意编辑器.snippet建议
。这是定义自动完成列表排序的设置,当您键入代码段的缩写时,该列表将显示。默认情况下,它是bottom
,这就是您的代码段出现在列表末尾的原因