JuliaEditorSupport / atom-language-julia

A Julia language support package for the Atom editor
Other
51 stars 39 forks source link

Create `@testitem` grammar #281

Closed MilesCranmer closed 4 months ago

MilesCranmer commented 4 months ago

See https://github.com/julia-vscode/TestItemRunner.jl/issues/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 commented 4 months ago

Seems like this isn't the right way (see https://github.com/julia-vscode/TestItemRunner.jl/issues/70) so closing.