在定义的这个片段中,keybindings.json
我试图对来自选择对话框的输入结果运行正则表达式转换 - 我需要插入两次相同的值,在第一个位置我需要第一个分号之前的部分,在第二个位置我想要完整的选择价值。
我尝试了文档中的示例,但它们似乎不适用于choice
,还是我遗漏了什么?我如何实现这一目标?
{
"key": "cmd+alt+ctrl+t",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "Before semicolon: ${2/(\\w);{1,}/$1/} & Full value: ${2|1; testValue1, 2; testValue2|}"
}
},
预期输出:
BeforeSemicolon: 1 & Full value: 1; testValue1