/haxemacs

Work in progress Emacs major mode for Haxe

Primary LanguageEmacs Lisp

Haxemacs

Work in progress Emacs major mode for Haxe. Currently working with Haxe 3.47. It will be reworked when Haxe 4 is released with the compiler services revamp.

Preview

Usage

Emacs Setup

Add the src path to be loaded in your init.el

(add-to-list 'load-path "/path/to/haxemacs/src")

Then require the following packages:

(require 'haxe-mode) ;; Syntax highlighting
(require 'company-haxe) ;; Autocomplete (depends on company)
(require 'haxe-eldoc) ;; Eldoc

Or if using use-package:

(use-package haxe-mode)
(use-package company-haxe)
(use-package haxe-eldoc)

Project Steup

Make sure the compiler service is running on port 6000:

haxe -v --wait 6000

Create a .haxe-root file in the source directory, pointing to the build.hxml file.

e.g. in /Source/.haxe-root:

../abs-build.hxml

Then in /abs-build.hxml

-main MainJs
-js Source/app.js
-D openfl=8.6.4
-cp /home/xdl/dev/openfl-yarpge/node_modules/openfl/lib
-cp /home/xdl/dev/openfl-yarpge/node_modules/actuate/lib
-cp Source
-D source-map

Note that any external libraries used in the build included with the cp flag need to contain their absolute paths.

Tests

Add the test path to be loaded in your init.el

(add-to-list 'load-path "/path/to/haxemacs/test")
(require 'run-tests) ;; or (use-package 'run-tests)

Run with:

(ert t)

Useful Resources