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

Snapshot language syntax highlighting broken by < character. #1013

Open
alumni opened this issue Mar 21, 2023 · 0 comments
Open

Snapshot language syntax highlighting broken by < character. #1013

alumni opened this issue Mar 21, 2023 · 0 comments

Comments

@alumni
Copy link

alumni commented Mar 21, 2023

Environment

  1. vscode-jest version: [5.2.3]
  2. node -v: [irrelevant]
  3. npm -v or yarn --version: [irrelevant]
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected): [irrelevant]
  5. your vscode-jest settings if customized:
    • jest.jestCommandLine? [irrelevant]
    • jest.autoRun? [irrelevant]
    • anything else that you think might be relevant? [irrelevant]
  6. Operating system: [irrelevant]

Prerequisite

  • are you able to run jest test from the command line? [X]
  • how do you run your tests from the command line? (for example: npm run test or node_modules/.bin/jest) [irrelevant]

Steps to Reproduce

expect(value).toMatchSnapshot({ property: expect.any(String) });

will generate:

{
  "property": Any<String>,
}

This is not highlighted correctly.

Relevant Debug Info

[irrelevant]

Expected Behavior

Syntax highlighting works for snapshot file containing <.

image

Actual Behavior

Syntax highlighting doesn't work for snapshot file containing <.

image

Seems this is an issue in the TextMate grammar that was copied by most extensions. Similar issue: tlent/jest-snapshot-language-support#2


The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant