PanAeon/vscode-tmgrammar-test

Updating snapshots and then re-running the snapshot tests fail

NTaylorMullen opened this issue · 3 comments

I didn't make any changes in-between the commands. I'd definitely expect this to pass:

image

File content: @@

TextMate Grammar being used
{
  "name": "ASP.NET Razor",
  "scopeName": "text.aspnetcorerazor",
  "patterns": [
    {
      "include": "#explicit-razor-expression"
    },
    {
      "include": "#escaped-transition"
    },
    {
      "include": "#implicit-expression"
    },
    {
      "include": "text.html.basic"
    }
  ],
  "repository": {
    "escaped-transition": {
      "match": "@@"
    },
    "transition": {
      "match": "@",
      "name": "keyword.control.razor.transition"
    },
    "explicit-razor-expression": {
      "name": "meta.expression.explicit.cshtml",
      "begin": "(@)\\(",
      "captures": {
        "0": {
          "name": "keyword.control.cshtml"
        }
      },
      "patterns": [
        {
          "include": "source.cs"
        }
      ],
      "end": "\\)"
    },
    "implicit-expression": {
      "begin": "(@)",
      "name": "razor.test.implicitExpression",
      "beginCaptures": {
        "1": {
          "patterns": [
            {
              "include": "#transition"
            }
          ]
        }
      },
      "patterns": [
        {
          "include": "#implicit-expression-invocation-start"
        },
        {
          "include": "#implicit-expression-accessor-start"
        }
      ],
      "end": "(?=[\\s<])"
    },
    "implicit-expression-invocation-start": {
      "begin": "([_[:alpha:]][_[:alnum:]]*)(?=\\()",
      "beginCaptures": {
        "1": {
          "name": "entity.name.function.cs"
        }
      },
      "patterns": [
        {
          "include": "#implicit-expression-body"
        }
      ],
      "end": "(?=[\\s<])"
    },
    "implicit-expression-accessor-start": {
      "begin": "([_[:alpha:]][_[:alnum:]]*)",
      "beginCaptures": {
        "1": {
          "name": "variable.other.object.cs"
        }
      },
      "patterns": [
        {
          "include": "#implicit-expression-body"
        }
      ],
      "end": "(?=[\\s<])"
    },
    "implicit-expression-body": {
      "name": "razor.test.implicitExpressionBody",
      "patterns": [
        {
          "include": "#balanced-parenthesis-csharp"
        },
        {
          "include": "#balanced-brackets-csharp"
        },
        {
          "include": "#implicit-expression-invocation"
        },
        {
          "include": "#implicit-expression-accessor"
        },
        {
          "include": "#implicit-expression-extension"
        }
      ],
      "end": "(?=[\\s<])"
    },
    "implicit-expression-accessor": {
      "match": "(?<=\\.)[_[:alpha:]][_[:alnum:]]*",
      "name": "variable.other.object.property.cs"
    },
    "implicit-expression-invocation": {
      "match": "(?<=\\.)[_[:alpha:]][_[:alnum:]]*(?=\\()",
      "name": "entity.name.function.cs"
    },
    "balanced-parenthesis-csharp": {
      "begin": "(\\()",
      "beginCaptures": {
        "1": {
          "name": "punctuation.parenthesis.open.cs"
        }
      },
      "name": "razor.test.balanced.parenthesis",
      "patterns": [
        {
          "include": "source.cs"
        }
      ],
      "end": "(\\))",
      "endCaptures": {
        "1": {
          "name": "punctuation.parenthesis.close.cs"
        }
      }
    },
    "balanced-brackets-csharp": {
      "begin": "(\\[)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.squarebracket.open.cs"
        }
      },
      "name": "razor.test.balanced.brackets",
      "patterns": [
        {
          "include": "source.cs"
        }
      ],
      "end": "(\\])",
      "endCaptures": {
        "1": {
          "name": "punctuation.squarebracket.close.cs"
        }
      }
    },
    "balanced-curlybraces-csharp": {
      "begin": "(\\{)",
      "beginCaptures": {
        "1": {
          "name": "punctuation.curlybrace.open.cs"
        }
      },
      "name": "razor.test.balanced.curlybraces",
      "patterns": [
        {
          "include": "source.cs"
        }
      ],
      "end": "(\\})",
      "endCaptures": {
        "1": {
          "name": "punctuation.curlybrace.close.cs"
        }
      }
    },
    "implicit-expression-extension": {
      "name": "razor.test.implicitExpression.Extensions",
      "patterns": [
        {
          "include": "#implicit-expression-dot-extension"
        },
        {
          "include": "#implicit-expression-null-conditional-extension"
        },
        {
          "include": "#implicit-expression-null-forgiveness-extension"
        }
      ]
    },
    "implicit-expression-dot-extension": {
      "match": "(\\.)(?=[_[:alpha:]][_[:alnum:]]*)",
      "captures": {
        "1": {
          "name": "punctuation.accessor.cs"
        }
      }
    },
    "implicit-expression-null-conditional-extension": {
      "match": "(\\?)(?=[.\\[])",
      "captures": {
        "1": {
          "name": "keyword.operator.null-conditional.cs"
        }
      }
    },
    "implicit-expression-null-forgiveness-extension": {
      "match": "(\\!)(?=(\\.[_[:alpha:]][_[:alnum:]]*)|\\?|[\\[\\(])",
      "captures": {
        "1": {
          "name": "keyword.operator.logical.cs"
        }
      }
    }
  }
}

Thank you for reporting this. I have reproduced the problem, and will release the fix soon. The issue is with using \n instead of platform independent EOL in parts of the source code.

@NTaylorMullen Hi, I've released new version 0.0.7 which should hopefully fix this issue. Could you try to reproduce it and tell if it still a problem for you? Thanks!

Closing this as I'm going to create a new ticket to get rid of all '\n' in the code. When I had been coding in Java I didn't allow myself such liberties.