An Haxe Bundle for Sublime Text 2 and Sublime Text 3
- Syntax highlighting for Haxe2 and Haxe3 sources and hxml build files
- Haxe compiler auto-completion, code hints, smart snippets and error highlighting / navigation
- NME and openfl support with completion, target selection and compilation
- Package and classes discovery/suggestion including classpath (-cp) and haxelib libraries (-lib)
- Multiple build management and automatic generation of hxml files
- Haxelib integration (install / remove / upgrade libs) with -lib autocompletion
- Code snippets, auto-import, Sublime build system integration
- HScript, Erazor and HSS support
and more to come :)
The most straight-forward way to install the bundle and to keep it up-to-date is through Package Control.
If you want to develop on a forked repo, you can clone it into the Packages folder:
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone https://github.com/<fork author>/haxe-sublime-bundle.git Haxe
cd ~/.config/sublime-text-2/Packages
git clone https://github.com/<fork author>/haxe-sublime-bundle.git Haxe
Using git bash
cd /c/Users/<username>/AppData/Roaming/Sublime\ Text\ 2/Packages
git clone https://github.com/<fork author>/haxe-sublime-bundle.git Haxe
Restart Sublime Text.
See How to install Package Control on Sublime Text 3.
For manual installation, the folders should be sublime-text-3
(Linux) or Sublime\ Text\ 3
(Windows, Mac OSX).
- Open your project directory (where the .hxml or .nmml resides) in Sublime Text, the build file should be detected automatically,
- Create new types through the sidebar's context menu
- Edit your classes (check the cool snippets, like 'prop'-Tab)
- Open parenthesis and comma keys display Haxe type hints in the status bar and inserts smart snippets
- Press Ctrl+Shift+B to either select among multiple builds, automatically generate an hxml file if none exist, or edit the build file if only one build exists
- Press Ctrl+Enter to run the current/selected build
- Press Ctrl+I on a qualified class name to shorten it and generate the import statement. Safe to use if the class is already imported.
- Press Ctrl+Shift+H and then :
- Ctrl+Shift+C to create a new class,
- Ctrl+Shift+I to create a new interface,
- Ctrl+Shift+E to create a new enum,
- Ctrl+Shift+T to create a new typedef
haxe_path
: Full path to the Haxe compiler, if not already in your PATH ("/usr/bin/haxe" or "C:\Program Files\Haxe\haxe.exe")haxe_library_path
: Full path to the standard lib, overriding HAXE_LIBRARY_PATHhaxe_build_server_mode
(true
by default) : Uses compilation server for building. The server is always used for completion, and may be restarted if needed through the command palette.haxe_smart_snippets
(true
by default) : Inserts smart snippets based on compiler hints after(
and,
Haxe NME is based on a specific .nmml
file (the .hxml
is generated) which is supported by this bundle.
To target openfl, use .xml
instead, like project.xml
.
- press Ctrl+Shift+B to select a NME target
- press Ctrl+Enter to build and run (regular Sublime Text build system won't work)
- You'll need a working installation of Haxe (
haxe
andhaxelib
): start by trying to compile your project directly through a terminal. - Open the Sublime Text Console (in View menu) to see what's going on.
- Don't hesitate to open an issue in case anything goes wrong.
As this bundle displays code hinting for method calls in the “status bar”, you may find it useful to increase its font-size.
SublimeText Editor Video Tutorial