Skip to content
r3a1ay edited this page Jun 20, 2015 · 9 revisions

Build selection / discovery

Open your project directory (where the .hxml or .nmml resides) in Sublime Text. The bundle should find your hxml file automatically, to provide autocompletion and build functionality. It will search for hxml files as follows :

  • If you opened only a file, it will scan from the file path up to your filesystem root.
  • If you opened folders, it will scan from the file path you opened up to the folder you opened that contains it. It will also scan the root of other opened folders.

In addition to that, you can manually add hxml files to your project by either right-clicking them and 'Add Haxe build file to project', or adding them manually to your haxe_builds project setting.

In ST3, if you use projects, the paths will persist across sessions.

When this feature is used, the bundle will only use the hxml files you provided, and no longer scan for other hxml files.

The haxe_builds setting is an array of either simple hxml paths (eg:"build/html5.hxml"), or of the form of 'current/working/dir@build/path.hxml'.

For example, if you add "my_project/haxe_sources@build/test.hxml", the bundle will run haxe build/test.hxml from my_project/haxe_sources.

(Please notice that only ST3 allows paths to be relative to project-file path)

Targeting NME/OpenFl/Flambe

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.
To target flambe, use .yaml.

  • press Ctrl+Shift+B to select a target
  • press Ctrl+Enter to build and run (regular Sublime Text build system won't work)

Shortcuts

Shortcut Description
Ctrl+Space display haxe completion
Ctrl+Alt+Space display type completion
Ctrl+Shift+Space show code hint
Ctrl+Shift+B either select among multiple builds (current file), automatically generate an hxml file if none exist, or edit the build file if only one build exists
Ctrl+Shift+Alt+B select build (all opened .hx files)
Ctrl+Enter run the current/selected build
Ctrl+I press on a qualified class name to shorten it and generate the import statement. Safe to use if the class is already imported
Ctrl+Shift+H, Ctrl+Shift+A create a new abstract
Ctrl+Shift+H, Ctrl+Shift+C create a new class
Ctrl+Shift+H, Ctrl+Shift+I create a new interface
Ctrl+Shift+H, Ctrl+Shift+E create a new enum
Ctrl+Shift+H, Ctrl+Shift+T create a new typedef
Ctrl+Shift+H, Ctrl+Shift+O [organize imports](Code generation#organize-imports)
Ctrl+< [go to definition](Code navigation#goto-definition-haxe) (Haxe 3.1.3+ required)
Ctrl+Shift+F1 show documentation on cursor (when previously autocompleted)
Ctrl+Shift+1 [generate code](Code generation)
Ctrl+Shift+2 refactoring

Settings

Key Description
haxe_path Full path to the Haxe compiler, if not already in your PATH (ex:"/usr/bin/haxe" or "C:\Program Files\Haxe\haxe.exe")
haxe_library_path Full path to the standard lib, overriding HAXE_LIBRARY_PATH and HAXE_STD_PATH (ex:"/usr/local/haxe/std")
haxelib_path Full path to Haxelib, if not already in your PATH (ex:"/usr/bin/haxelib" or "C:\Program Files\Haxe\haxelib.exe")
haxe_build_server_mode Uses compilation server for building
haxe_completion_server_mode Uses compilation server for autocompletion
haxe_auto_complete Display haxe completion while typing
haxe_smart_snippets Inserts smart snippets based on compiler hints after ( and ,
haxe_use_popup Show popups instead of smart snippets (requires sublime text 3 build 3070 or higher)
haxe_builds Adds hxml files to your project, and disable hxml file scan (see above)
haxe_errors_style Error highlighting style (outline, fill, none)
haxe_errors_gutter_style Gutter icon for highlighted error or none
haxe_fields_order [Class structure](Code style#class-structure) configuration
haxe_modifiers_order [Modifiers order](Code style#modifiers) configuration
haxe_whitespace_style [Whitespaces](Code style#spaces) configuration
haxe_whitespace_style2 [Whitespaces](Code style#spaces) configuration
haxe_brace_style [Brace style](Code style#braces) configuration
haxe_group_property_and_accessors Group getter and setter with property
haxe_bl_file_top The number of blank lines at the top of the file
haxe_bl_top The number of blank lines at the top of the class
haxe_bl_property The number of blank lines between property, getter and setter
haxe_bl_group The number of blank lines between groups (e.g. between variables and methods)
haxe_bl_var The number of blank lines between variables
haxe_bl_method The number of blank lines between methods
haxe_use_cache Cache haxe classes to speed up plugin initialization
haxe_flambe_target Used to store last selected flambe target
haxe_nme_target Used to store last selected nme target