我已经在Visual代码中配置了以下TypeScript片段
"console.log": {
"prefix": "cl",
"body": [
"console.log();"
],
"description": "console.log()"
}但是,它不起作用,因为已经为cl (类)定义了一个片段。我怎么才能用我的代码来覆盖这个片段呢?我想使用cl,因为我有其他IDE配置相同的方式,并且不愿意更改我的约定。
发布于 2016-10-17 17:05:26
当您键入cl时,会显示cl代码段的所有可能扩展的列表,并且您的代码片段可能在列表的底部。为了访问列表顶部的代码段,可以将以下内容添加到settings.json中
// Place your settings in this file to overwrite the default settings
{
"typescript.useCodeSnippetsOnMethodSuggest": true,
"editor.snippetSuggestions": "top",
"editor.tabCompletion": true
}这里请注意editor.snippetSuggestions。此设置定义了在键入代码段缩写时出现的自动完成列表的排序。默认情况下,是bottom,这就是为什么您的代码片段出现在列表的末尾。
https://stackoverflow.com/questions/40091530
复制相似问题