https://github.com/vshaxe/haxe-tmlanguage
TextMate grammars for Haxe and HXML
https://github.com/vshaxe/haxe-tmlanguage
haxe hxml language-grammars syntax-highlighting
Last synced: 8 months ago
JSON representation
TextMate grammars for Haxe and HXML
- Host: GitHub
- URL: https://github.com/vshaxe/haxe-tmlanguage
- Owner: vshaxe
- License: mit
- Created: 2017-01-29T14:32:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-07-30T12:14:04.000Z (11 months ago)
- Last Synced: 2025-07-30T14:52:41.849Z (11 months ago)
- Topics: haxe, hxml, language-grammars, syntax-highlighting
- Language: Haxe
- Homepage:
- Size: 617 KB
- Stars: 8
- Watchers: 5
- Forks: 10
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# haxe-TmLanguage
[](https://github.com/vshaxe/haxe-TmLanguage/actions?query=workflow%3ACI)
This repository contains `.tmLanguage` grammars for Haxe and HXML. They are currently used by the following projects:
- [vshaxe](https://github.com/vshaxe/vshaxe) (Haxe Extension for Visual Studio Code)
- [linguist](https://github.com/github/linguist) (used for github.com's syntax highlighting)
- [haxe.org](https://github.com/HaxeFoundation/haxe.org)
## Haxe example

## HXML example

## Building
First install the dependencies:
```
npm install
```
### Conversion
The `tmLanguage` XML files are converted from their `YAML-tmLanguage` source files like this:
```
npx lix run vshaxe-build --target tm-language-conversion
```
### Tests
There are some automated tests that can be run like this:
```
npx lix run vshaxe-build --target tm-language-tests
```
`/cases` contains the actual test cases. When running `build.js`, scope-annotated files are generated into the `/generated` directory. During the test step (running `test.js`), the files in `/baselines` are compared with the newly `/generated` ones, and the test fails if they are different.
So when adding a new test, follow these steps:
- create a new test case in `/cases`
- verify that the highlighting is ok
- run `build.js` and copy the new file in `/generated` into `/baselines`
## Workflow
For convenience, there exists a `tm-language` target, which runs both the `tm-language-conversion` and `tm-language-tests` targets. If you have this project open in VSCode, you can just execute the build task (Ctrl+Shift+B) to run the `tm-language` target.
VSCode currently needs to be restarted to pick up changes to grammar files. Hence it is helpful to assign an easily accessible shortcut to the `Reload Window` command, for instance F6. Sublime Text's [PackageDev](https://github.com/SublimeText/PackageDev) extension may offer a better workflow in this regard.
VSCode has a "Developer: Inspect Editor Tokens and Scopes" command that can be very helpful.