Skip to content

Maintained, parser-aligned grammars for VS Code's unmaintained TextMate bundles (vscode#203212) #91

Maintained, parser-aligned grammars for VS Code's unmaintained TextMate bundles (vscode#203212)

Maintained, parser-aligned grammars for VS Code's unmaintained TextMate bundles (vscode#203212) #91

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Node 24+ runs the .ts sources directly (native type stripping) — no build, no tsx.
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm ci
- name: Typecheck
run: npx tsc --noEmit
# Regenerate every grammar's artifacts and fail if any drifts from the committed
# files (someone edited a grammar but forgot to regenerate). Covers all four
# grammars (sources at the repo root) + the tree-sitter packages.
- name: Generate editor artifacts (must be in sync)
run: |
npm run gen
git diff --exit-code -- '*.tmLanguage.json' '*.language-configuration.json' '*.monarch.json' '*.cst-types.ts' '*.contributes.json' tree-sitter
# Self-contained suites (each exits non-zero on failure). The conformance /
# coverage / bench tools needing the external TypeScript corpus or VS Code's
# grammar are excluded; tsx/jsx conformance use only the bundled tsc.
- name: Test
run: |
node test/sanity-check.ts
node test/agnostic.ts
node test/refactor-guard.ts
node test/test-issues.ts
node test/js-conformance.ts
node test/tsx-conformance.ts
node test/jsx-conformance.ts
node test/html-lexer-spike.ts
node test/html-conformance.ts
node test/html-highlight.ts
node test/html-monarch.ts
node test/html-embed-js.ts
node test/vue-highlight.ts
node test/vue-directives.ts
node test/vue-embed-boundary.ts
node test/vue-interp-expr.ts
# The derived tree-sitter highlighter is the strongest thesis proof (a real GLR
# parser from the same grammar, beating the official hand-written one). Build its
# wasm and gate the accuracy so the 95.9% is verified, not just claimed. The
# tree-sitter CLI bundles its own wasm toolchain — no emscripten/docker needed.
treesitter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm ci
- name: Build the derived tree-sitter grammar to wasm
run: |
cd tree-sitter/typescript
npx tree-sitter generate
npx tree-sitter build --wasm .
- name: Tree-sitter accuracy gate (≥ floor, must beat official)
run: node test/treesitter-bench.ts
- name: Build + gate the derived HTML tree-sitter grammar (v1, vs parse5)
run: |
cd tree-sitter/html
npx tree-sitter generate
npx tree-sitter build --wasm .
cd ../..
node test/html-treesitter.ts