Skip to content
TextMate grammars for Haxe and HXML
Haxe
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Enable "editor.formatOnPaste" Sep 12, 2019
baselines Fix HXML names with substrings of arguments, closes #44 Jun 19, 2019
cases Fix HXML names with substrings of arguments, closes #44 Jun 19, 2019
haxe_libraries Use lix for dependency management Jun 14, 2019
helper Fix Travis Jun 1, 2019
images Make sure image isn't too wide Jan 29, 2017
src Update for js.lib on Haxe dev Apr 17, 2019
.gitignore Fix conditionals followed by comments, closes #1 Jan 31, 2017
.haxerc Update to Haxe 4.0.0-rc.4 Sep 4, 2019
.travis.yml Use lix for dependency management Jun 14, 2019
LICENSE.md Add LICENSE.md Mar 6, 2017
README.md Update build instructions Jun 14, 2019
haxe.YAML-tmLanguage Add @:persistent to the list of compiler metadata Jun 10, 2019
haxe.tmLanguage Add @:persistent to the list of compiler metadata Jun 10, 2019
hxml.YAML-tmLanguage Fix HXML names with substrings of arguments, closes #44 Jun 19, 2019
hxml.tmLanguage Fix HXML names with substrings of arguments, closes #44 Jun 19, 2019
package-lock.json Update devDependencies and Haxe Aug 12, 2019
package.json Update devDependencies and Haxe Aug 12, 2019
vshaxe-build.json

README.md

haxe-TmLanguage

Build Status

This repository contains .tmLanguage grammars for Haxe and HXML. They are currently used by the following projects:

  • vshaxe (Haxe Extension for Visual Studio Code)
  • linguist (used for github.com's syntax highlighting)
  • haxe.org

Haxe example

Haxe highlighting

HXML example

hxml highlighting

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 extension may offer a better workflow in this regard.

The following VSCode extensions are helpful for working on the grammar files:

  • scope-info - Shows tmLanguage scopes for the token under the cursor. Note: since VSCode 1.9.0, an Inspect TM scopes is built-in, but it uses the current caret location / doesn't work on hover.
  • TextMate Languages - Adds proper syntax highlighting for tmLanguage files.
You can’t perform that action at this time.