Skip to content

Commit

Permalink
Merge pull request #43 from gfgafn/improve-doc
Browse files Browse the repository at this point in the history
chore: improve doc and update CI config
  • Loading branch information
Wilfred authored Jan 24, 2024
2 parents 056750b + a960593 commit 54f4221
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: run Textmate scope tests
run: npx vscode-tmgrammar-test@0.0.11 -s source.rust -g syntaxes/rust.tmLanguage.json -t "test/**/*.rs"
# use the same version of vscode-tmgrammar-test as in package.lock.json
run: npx vscode-tmgrammar-test@0.1.1 "./test/**/*.rs" --compact --grammar ./syntaxes/rust.tmLanguage.json
build:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 3 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
},
{
"label": "Test TM scopes",
"type": "shell",
"command": "npx vscode-tmgrammar-test -c -s source.rust -g syntaxes/rust.tmLanguage.json -t \"test/**/*.rs\"",
"type": "npm",
"script": "test",
"detail": "npm run test-TM-scope",
"group": {
"kind": "test",
"isDefault": true
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ The VS Code command `Developer: Inspect Editor Tokens and Scopes` will show you
## Contributing

The grammar is maintained as YAML, using tasks to generate JSON on save (please don't edit the JSON grammar directly).
You can regenerate the JSON manually from the command palette using
`Tasks: Run Build Task`, or running `gulp yaml` in a terminal.

[Rust Analyzer]: https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer
```sh
npm install

# Watch for changes of YAML files and regenerate JSON
npm start

# Run tests
npm test
```

If you are using VS Code, you can use the `Tasks: Run Build Task` command from the command palette to run the gulp task. And you can use the `Tasks: Run Test Task` command to run the tests.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"author": {
"name": "dustypomerleau"
},
"scripts": {
"start": "npx gulp watch-yaml",
"test": "npm run test-TM-scope",
"test-TM-scope": "npx vscode-tmgrammar-test \"./test/**/test*.rs\" --compact --grammar ./syntaxes/rust.tmLanguage.json"
},
"repository": {
"type": "git",
"url": "https://github.com/dustypomerleau/rust-syntax"
Expand Down

0 comments on commit 54f4221

Please sign in to comment.