How to define and use custom variable for VS Code snippets

Viewed 191

Is there any way to define custom variables for VS Code snippets? Particularly, I want to set variable values from settings. For example, with config setting "my-user-name-test.user.name" in setting.json, I want to define snippets like the below example.

{
    "Input User Name": {
        "prefix": "user-name",
        "body": [
            "{",
            "    \"user_name\": \"${config:my-user-name-test.user.name}\"",
            "}"
        ],
        "description": "Test config user name"
    }
}
0 Answers
Related