cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Snippet with `insertionScopeType: branch` will inherit the target branch's indentation level (python)

Open MartinRykfors opened this issue 3 years ago • 0 comments

Input:

if True:
    air()

Snippet definition (named else if)

{
  "elseIfStatement": {
    "definitions": [
      {
        "scope": {
          "langIds": [
            "python"
          ]
        },
        "body": [
          "elif $condition:",
          "\t$consequence"
        ]
      }
    ],
    "description": "Else if statement",
    "variables": {
      "consequence": {
        "wrapperScopeType": "statement"
      }
    },
    "insertionScopeTypes": [
      "branch"
    ]
  }
}

Saying snippet else if after air results in

if True:
    air()
    elif _:
        _

But we expect

if True:
    air()
elif _:
    _

MartinRykfors avatar Jun 13 '23 08:06 MartinRykfors