vscode配置Configure User Snippets 不生效
正常Ctrl+shift+p打开"设置",Configure User Snippets -> python.json
{ // Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the // same ids are connected. // Example: // "Print to console": { // "prefix": "log", // "body": [ // "console.log('$1');", // "$2" // ], // "description": "Log output to console" // } // 自己定义的snippet "Print2": { "prefix": "print2", "body": [ "print('$1')", "print('-' * 30)", "print($1)", "print('-' * 30)" ], "description": "Log output to console" }, "Print@": { "prefix": "print@", "body": [ "print('@' * 30)" ], "description": "Log output to console" } }
配置完保存就行了,但是我的死活不生效,查了半天终于找到原因。
解决方法:
以json文件的形式打开"设置",设置->Open Settings(JSON),
"editor.suggest.showSnippets"改成true,否则怎么设置都不会生效
{ "editor.suggest.showSnippets": true, }
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
2021-07-14 python的re(正则表达式)
2021-07-14 正则表达式基础