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

Create @testitem grammar #281

Closed
wants to merge 3 commits into from

Conversation

MilesCranmer
Copy link

@MilesCranmer MilesCranmer commented May 7, 2024

See julia-vscode/TestItemRunner.jl#70 – recommended by @pfitzseb to make a PR here.

The grammar is as follows:

"testitem_block" : {
  "patterns": [
    {
      "name": "keyword.other.testitem.julia",
      "begin": "^@testitem\\b",
      "beginCaptures": {
        "0": {
          "name": "keyword.other.testitem.begin.julia"
        },
        "1": {
          "name": "keyword.control.begin.julia"
        }
      },
      "end": "^end\\b",
      "endCaptures": {
        "0": {
          "name": "keyword.other.testitem.end.julia"
        }
      },
      "comment": "@testitem block for unit-testing. MUST begin with `@testitem` on a new line, and end with `end` on a new line.",
      "patterns": [
        {
          "include": "$self"
        }
      ]
    }
  ]
}

Hopefully I did it right. I added a lot of tests btw.

@MilesCranmer MilesCranmer changed the title Add test for failure mode of testitem capture Create @testitem grammar May 7, 2024
},
{
'value': 'begin',
'scopes': ['keyword.other.testitem.julia', 'keyword.control.julia']
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note how everything is now within this keyword.other.testitem.julia block of code, so you could potentially change the highlighting of it.

@MilesCranmer
Copy link
Author

Seems like this isn't the right way (see julia-vscode/TestItemRunner.jl#70) so closing.

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

Successfully merging this pull request may close these issues.

1 participant