Haxe 4.0.0 Preview.4 Released

Haxe 4.0 got one step closer with today’s release of Haxe 4.0.0 preview 4.  The release focuses heavily on improved compiler display services that will enable better editor support in IDEs such as Visual Studio Code.  Change will support auto imports, override completions, structure field name completion and more.  The Visual Studio code extension has already been updated to support the new Haxe 4.0.0 functionality.

Details of the release:

Improved compiler display services

Our focus for this release has been compiler display services. We implemented a new, JSON-RPC-based protocol which is utilized by the vshaxe Visual Studio Code Extension to provide a variety of new features:

  • Support for auto-import
  • Completion on override |
  • Completion for structure field names
  • Support for auto-generating structure declarations, functions, switches and more
  • Context-aware, sorted toplevel completion
  • Reference finding which explores modules that are not necessarily part of the compilation

Improved enum abstracts

Enum abstracts now get the treatment they deserve with a proper enum abstract syntax. Furthermore, values can now be omitted if the enum abstract is defined over Int or String:

enum abstract MyEnum(String) {      var MyValue; // implicit = "MyValue"  }    enum abstract MyOtherEnum(Int) {      var MyValue0; // implicit = 0      var MyValue1; // implicit = 1      var MyValue5 = 5;      var MyValue6; // implicit = 6  }  

Various syntactic improvements

  • extern is now recognized as a field-level modifier and can be used instead of @:extern
  • Metadata names can now use dots, e.g. @:haxe.json becomes a metadata entry named “haxe.json”
  • Structure fields now consistently allow var ?x and final ?x, meaning the same as @:optional var x
  • Type1 & Type2 is now a recognized syntax for intersection types. For the time being, it is only supported to merge structures (replacing the { >Type1, >Type2, } syntax) and for type parameter constraints (replacing T:(Type1, Type2) which has been removed from the language).

Be sure to check the change log for a complete list of changes and bug fixes in the release.  You can download Haxe 4.0.0 p4 right here.  If you are interested in developing games using the Haxe programming language be sure to check out our new Armory tutorial series or our HaxeFlixel tutorial series available here.

GameDev News


Scroll to Top