Feature Request: Native support ${num:$Snippet(prefix)} to nest other code snippets & trigger snippets inside quotes/brackets
@alexdima is already working on this.
Since Jun 29, 2026.
Assessment
This issue has not been assessed yet.
Description
现有问题
- VS Code原生snippet不支持内嵌其他片段,网上$Snippet()语法仅第三方插件可用,换环境插件失效
- 光标在单/双引号、圆括号内部时,无法检索、触发code-snippets代码片段,复用片段很麻烦
期望新增功能
- 原生支持
${1:$Snippet(片段prefix)}语法,自动加载对应prefix的片段并继承下拉占位符 - 增加设置开关:允许在字符串引号、括号内部检索、触发代码片段
- 支持多段占位符独立跳转,不共享同编号同步编辑冲突
使用场景(我的PowerMill宏开发场景)
我大量复用「元素」下拉片段,在pathname函数参数引号内需要反复输入前缀手动Tab切换,原生不支持嵌套,代码冗余严重。
示例片段:
{
"元素路径": {
"prefix": "pathname = 取激活元素路径",
"body": [
"pathname('${1:$Snippet(元素)}','${2:$Snippet(元素)}'.name)"
]
},
"元素": {
"prefix": "元素",
"body": ["${1|toolpath,tool,Boundary,Pattern|}"]
}
}
替代方案现状
只能拆分占位符到引号外,或安装第三方插件,兼容性差,团队共享片段会出现大量失效。
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·