Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Gala80 opened this issue Jan 23, 2018 · 1 comment
Closed

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

Gala80 opened this issue Jan 23, 2018 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug snippets verified Verification succeeded
Milestone

Comments

@Gala80
Copy link

Gala80 commented Jan 23, 2018

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;

@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug snippets labels Jan 23, 2018
@jrieken jrieken added this to the January 2018 milestone Jan 23, 2018
@jrieken
Copy link
Member

jrieken commented Jan 23, 2018

Thanks. Good find, stretch for Jan...

@roblourens roblourens added the verified Verification succeeded label Feb 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug snippets verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants