Skip to content

“Nested” snippets terminating abruptly in VSCode 1.19.2. #42012

@Gala80

Description

@Gala80

VSCode Version:
Nov. ’17 (1.19.2)
Also, 1.20.0-insider

OS Version:
MacOS High Sierra

Does this issue occur when all extensions are disabled?
Yes

Issue:

  • “Nested” snippets appear to be "terminating" abruptly in VSCode Nov. ’17 (1.19.2), before "completing" the entire snippet.

Additional info:

  • Things worked differently/as expected in VSCode Sept’ 17 (1.17.2), where the entire snippet successfully "completed".
  • Although never having used VSCode Oct. '17 (1.18.X), I have confirmed this "terminating" behavior to also exist in VSCode 1.20.0-insider as well.

Steps to reproduce:

  • Below is a simplified snippet, which completes as expected in VSCode Sept’ 17 (1.17.2).
  • It basically creates a variable and adds itself/another variable to it, plus 1.

"var_snippet": {
        "prefix": "s_var",
        "body": [
            "var ${2:${1:name}} = ${3:${1:name}} + 1;${0}"
        ],
        "description": "Creates a var and adds 1"
    }

  1. Initial snippet state. Both name’s are selected.
    var name = name + 1;

  2. Type ‘x’ to change to:
    var x = x + 1;

  3. Tab should now take you to/select only the ‘left x’.
    var x = x + 1;

  4. Type ‘y’ in order to change the left ‘x’ to ‘y’.
    var y = x + 1;


VSCode Nov’ 17 (1.19.2).
(Also VSCode 1.20.0-insider)

  • This is where things no longer work the same/as expected.
  • Typing the above ‘y’ now causes the snippet to “terminate”.
  • Pressing Tab at this point inserts an actual Tab following the 'y', instead of finishing the rest of the snippet.

However, in VSCode Sept’ 17 (1.17.2), the snippet continues on as expected.

  1. Tab should now take you to the ‘right x’.
    var y = x + 1;

  2. Optionally, type something (for example, ‘z’).
    var y = z + 1;

  3. Regardless if you typed the above ‘z’ or left it as an 'x',
    the final Tab should then take you to the end of the line and “complete” the snippet.
    var y = z + 1;

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugsnippetsverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions