Giter Site home page Giter Site logo

haxe-tmlanguage's Introduction

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

This project uses vshaxe-build. Run this command to install it:

haxelib git vshaxe-build https://github.com/vshaxe/vshaxe-build

Conversion

The tmLanguage XML files are converted from their YAML-tmLanguage source files like this:

haxelib install yaml
haxelib git plist https://github.com/back2dos/plisthaxelib
haxelib run vshaxe-build --target tm-language-conversion

Tests

There are some automated tests that can be run like this:

haxelib install hxnodejs
npm install vscode-textmate
haxelib 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.

haxe-tmlanguage's People

Contributors

gama11 avatar jeremyfa avatar nadako avatar simn avatar

Watchers

Juraj Kirchheim avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.