如何在Visual Studio代码中替换代码段中的变量?

问题描述 投票:0回答:1

我使用具有绑定功能的javascript代码段。

我在下面有此代码:

    {
        "key": "alt+c", 
        "command": "editor.action.insertSnippet",
        "when": "editorTextFocus",
        "args": {
            "snippet": " const $TM_CURRENT_WORD = $1"
        }
    },

如果我键入box,然后按alt + c,我得到...

box const box = 

但是我期望

const box =

我该如何实现?

visual-studio-code code-snippets
1个回答
0
投票
最简单的方法是先选择box文本,然后选择

alt

© www.soinside.com 2019 - 2024. All rights reserved.