GithubHelp home page GithubHelp logo

kode / haxe-tmlanguage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vshaxe/haxe-tmlanguage

0.0 2.0 0.0 521 KB

TextMate grammar files for Haxe and hxml used by the vshaxe extension

License: MIT License

Haxe 100.00%

haxe-tmlanguage's Introduction

haxe-TmLanguage

CI

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.

VSCode has a "Developer: Inspect Editor Tokens and Scopes" command that can be very helpful.

haxe-tmlanguage's People

Contributors

gama11 avatar nadako avatar simn avatar alanvf avatar

Watchers

Robert Konrad avatar James Cloos 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.