Repository navigation
The Haxe Tool Window
The Haxe tool window is where you configure and drive a Haxe project in version 2.0: its modules, build files, targets, defines, libraries, actions and tools. This page describes every row of its tree, the toolbar and the context menu. For the ideas behind modules, build files and targets, see Core Concepts.
Open it with View | Tool Windows | Haxe, or click the Haxe icon on the right tool window bar.
The tree has one root row for the project. Under it come the project's own groups and one row per module. A typical
project looks like this (values are shown in gray; on a row marked ▾, you click the value to change it):
my-app
├── Compilation
│ ├── Build command haxe build.hxml ▾
│ ├── Compilation server on (idle) ▾
│ ├── Connection mode --server-connect (host:port) ▾
│ └── Server instance shared ▾
├── IDE environment
│ ├── SDK Project default (Haxe 4.3.7) ▾
│ └── Language level From SDK (4.3) ▾
├── Build files (2)
│ ├── build.hxml (Active)
│ │ ├── Target HashLink
│ │ ├── Defines (1)
│ │ ├── IDE Overrides (1)
│ │ │ ├── Defines (1)
│ │ │ │ └── debug_overlay
│ │ │ └── Custom target (not specified) ▾
│ │ ├── Libraries (2)
│ │ └── Actions (2)
│ │ ├── Build
│ │ └── Build & run HashLink Application
│ └── test.hxml (Tests)
│ ├── ...
│ └── Tests
│ └── Run Unit Tests
├── Tools (2)
│ ├── Format sources hxformat.json
│ └── Check formatting hxformat.json
└── server
└── ...
Many rows have a tooltip that explains them; hover over a row to see it.
- The project row is the top of the tree. In most projects the project folder is also a module: the one IntelliJ IDEA creates when you open a folder. That module gets no row of its own; its groups sit directly under the project row instead. Build files in the project folder that no module owns are shown there too.
- A module row appears for every other module, sorted by name.
Each module row, and the project row in the cases above, holds these groups, in this order:
| Group | What it holds |
|---|---|
| Compilation | How the IDE builds this module and reaches its compiler: its build command, its use of the compilation server, the connection mode and the server instance. |
| IDE environment | IDE-side settings for this module: SDK and language level. |
| Build files | The module's build files, with their targets, defines, IDE overrides, libraries and actions. |
| Tools | Developer tools such as the formatter. Shown only when the module has at least one tool. |
To turn a subfolder into a module of its own, use Add Module from Folder on the toolbar. To hide modules that have no build files, no tools and nothing you configured, turn on Hide Empty Modules in the toolbar's Filter menu.
| Row | What it shows | Click the value to |
|---|---|---|
| Build command | The command that Build Project and Build Module run for this module: the one you set, the module's default marked (default), (skipped on project build), or (not set) when there is no default. | Open the Build Command dialog. |
| Compilation server | Whether this module compiles through the compilation server: on (idle), on (port n), off, on (not connectable) or disabled (enable in Build Tools settings). | Turn the server on or off for this module. While the server is disabled for the whole project, the click opens its settings instead. |
| Connection mode | How completion, diagnostics, navigation and types reach the compiler of the module's SDK, shown as the flag that compiler process starts with: --server-connect (host:port) or --server-listen (host:port) for Haxe 4 and later, --wait stdio or --wait host:port for Haxe 3. It reads off unless the Compilation server row reads on (idle) or on (port n). | Pick a mode from the Connection Mode for Haxe 4 and later or Connection Mode for Haxe 3 list. The choice applies to every SDK of that Haxe generation. |
| Server instance | Which compilation server serves this module: shared, the server of its SDK that every module of that SDK uses, or dedicated, a server of its own with a cache of its own. | Pick shared or dedicated. Picking shared again stops the dedicated server. |
When a compiler request for the module fails, the server row adds a red (compiler requests failing) until a request succeeds again. Click that text to open the Haxe Compilation Server tool window, which shows the errors.
The build command is covered in Building and Running, the server in Compilation Server, the server instance in A server for one module, the connection mode in Where editor requests go.
These settings are kept by the IDE and never written into your build files. The SDK also decides which Haxe and haxelib the module's builds, runs and library lookups use.
| Row | What it shows | Click the value to |
|---|---|---|
| SDK | The Haxe SDK this module uses, or Project default (SDK name), which follows the SDK chosen in Settings | Build, Execution, Deployment | Build Tools | Haxe. A missing SDK is shown in red. | Pick an SDK from the Select Haxe SDK list. |
| Language level | The Haxe version the editor assumes for this module. Without a level of its own, the module takes the default: From SDK (level), the level of its SDK's Haxe version; Project default (level), when a Default language level: is chosen in Settings | Build, Execution, Deployment | Compiler | Haxe Compiler; or No SDK (level), the latest level, when the module has no SDK. | Pick a level, or the default, from the Select Language Level list. |
The language level is explained in Core Concepts. Define overrides and the custom target belong to each build file; see IDE Overrides.
The Build files group lists the module's build files: the ones the plugin found plus the ones you added by hand. Which files are found, and how to add or hide one, is explained in Build Files.
A build file row shows the file name and its markers:
- (Active), with the name in bold: the project's active build file. There is at most one in the whole project. A source file that several build files compile equally, and a library file that several builds use, is analyzed under the active build file unless you pick another; see Resolve Context.
- (Tests): one of the module's tests build files.
-
(build tool failed): the Lime, OpenFL or NME tool could not evaluate the file, for example because it is not valid
XML or an
<include>is missing. The tooltip shows the tool's message, and the file's defines, libraries and class paths come from reading the file itself until the tool succeeds. The open file shows the same message in a banner.
Double-click a build file row to open the file in the editor. Under it you find:
| Row | What it shows |
|---|---|
| Target | The target the file builds. For Lime, OpenFL, NME and HXP project files you click its value to pick a target from the Select Target list. For an hxml file the target comes from the file itself and cannot be changed here; a --custom-target build shows Custom (name). A plain HXP script has no target row. |
| Section | Only for hxml files that chain several compilations with --next: the compilation the tree follows. Click its value to pick another one. |
| Defines | The defines the file sets, as name = value. |
| IDE Overrides | Defines and a custom target that the IDE adds to this file for code analysis only; see IDE Overrides. |
| Libraries | The haxelib libraries the file uses, as name : version, each with the libraries it requires below it. A library that is not installed is shown in red with (missing), or with (version not installed) when another version is installed. A library pinned to a git repository shows git# followed by the pinned branch, tag or (shortened) commit; the tooltip shows the repository. |
| Actions | Commands for this file. Double-click one to run it. |
| Tests | Only on a tests build file: the Run Unit Tests row. |
Targets and sections are explained in Targets and Sections.
The IDE Overrides row under a build file holds what the IDE adds to that build for code analysis. Compiler-backed features get it too; builds and runs never do. The overrides are saved with the project and follow the build file when you move or rename it.
| Row | What it shows | Click the value to |
|---|---|---|
| Defines | The define overrides, as name = value. One that the build file also sets is marked (overrides build file). One that removes a define is shown struck through, followed by Remove. |
Nothing: expand the row to see the entries. |
| Custom target | Only for hxml files: the custom target name, or (not specified). When the build selects a target of its own, that target wins: the name is struck through, followed by (build sets target). | Enter a name in the Custom Target dialog; leave it empty to clear it. Names the compiler would reject are refused with a message. |
Right-click a row to add, edit or remove defines (Add Define…, Add Undefine…, Edit Define…, Remove Define), or choose Manage IDE Overrides… to edit the defines and the custom target in one dialog. See Defines and Custom Targets and Custom targets.
The Actions group holds three kinds of rows:
-
Built-in actions for the file type: Build for an hxml file (
haxe build.hxml), plus Clean when it builds C++;test,run,buildandcleanfor Lime, OpenFL, NME and HXP project files; andbuildfor a plain HXP script. - Custom actions you added with Add Action… or Duplicate Action…. An action that launches a run configuration shows what it starts in gray. An action without a command of its own only runs the actions it runs first.
- Build & run, when the file's output is something the IDE can launch. The gray text names the kind of run configuration it uses, for example HashLink Application. JavaScript from an hxml file gets two such rows, one for the browser and one for Node.js; an interpreter build gets a Run row instead.
Hover over an action to see its command, the actions it runs first and what it starts. An action it runs first that no longer exists is marked (missing).
Running an action creates a Haxe Action run configuration named after the file and the action (for example
build.hxml Build), or reuses it, so you can run it again from the run configuration list. An action that launches a
run configuration runs that one instead. Build & run creates (or reuses) a run configuration for the target, named
like build.hxml (HashLink), that builds the file first and then launches the output. See
Building and Running and Run Configurations.
The Tools group appears when the module has tools:
-
Run checkstyle, when a
checkstyle.jsonfile is in the module's root folder. -
Format sources and Check formatting, when an
hxformat.jsonfile is in the module's root folder. - Tools you added with Add Tool….
The gray text names the configuration file a tool was found from, or shows the command of a tool you added. Double-click a tool to run it. See Tools.
| You do | What happens |
|---|---|
Click the gray value of a row marked ▾, or the ▾
|
Opens its chooser or dialog; a chooser drops down under the row. On the Compilation server row, the click turns the server on or off. The pointer turns into a hand over a value you can click. |
| Click a row's label | Selects the row. |
| Double-click | Runs the row's action: opens a build file, or runs an action, tool, Build & run entry or Run Unit Tests. On a row marked ▾, does what a click on its value does. |
| Press Enter | Does what a double-click does; on a row without an action or a chooser, expands or collapses the row. |
| Press Delete | Removes the selected build file, define override or module, after asking you. An automatically found build file is hidden instead of removed. The toolbar's remove button does the same. |
| Jump to Source (F4 on Windows and Linux, ⌘↓ on macOS) | Opens the build file from its row, its Target row, its Actions rows and Build & run; goes to where a define under Defines is declared; selects a library under External Libraries in the Project view. |
| Start typing | Searches the tree for matching rows. |
The tree remembers which rows you expanded, even across IDE restarts.
| Button | What it does |
|---|---|
| Reload Haxe Project | Saves open files, reads all build files again, updates the module libraries, refreshes the compiler results and rebuilds the tree. |
| Purge Caches | Clears cached library and compiler data: the haxelib information, the results of reading Lime, OpenFL and NME files, and the compiler results. Then it rebuilds the tree. It does not restart compilation servers. |
| Add Module from Folder | Turns a subfolder that contains a Haxe project into a module. The folder becomes the module's root, and the module is named after the folder. |
| Remove Module | Removes the selected module from the project, after asking you. Files on disk are not deleted. With a build file selected, the button becomes Remove Build File or Hide Build File; with a define override selected, Remove Define. |
| Execute Haxe Command | Asks for compiler arguments (it suggests the ones you used last, -version the first time) and runs haxe with them in the project directory. The output appears in the Run tool window. |
| Haxe Settings | Opens Build Tool Settings… (Settings | Build, Execution, Deployment | Build Tools | Haxe) or Compiler Settings… (Settings | Build, Execution, Deployment | Compiler | Haxe Compiler). |
| Filter | Hide Empty Modules hides module rows that have no build files, no tools and nothing you configured. Hide Empty Nodes hides groups without rows, such as an empty Defines, IDE Overrides or Libraries group, and a Custom target row that is not set. |
| Expand All, Collapse All | Expand or collapse the whole tree. |
Right-click a row to see the actions for it. Only the actions that apply to the row are shown.
| Row | Actions |
|---|---|
| Project row, module row | Run Unit Tests (disabled while the module has no tests build file), Debug Unit Tests (when it has one), Add Tool… |
| Build file | Set as Active Build File (unless it is already active), Mark as Tests Build File or Unmark as Tests Build File, Set Working Directory… (hxml files only), Reload, Add Build File…, Remove Build File or Hide Build File, Show Project Diagram |
| Any row under a build file | Reload |
| Build files group | Add Build File… |
| Target (Lime, OpenFL, NME, HXP project) | Select Target |
| Section | Select Compilation Section |
| Libraries group | Install All Missing Libraries (when a library is missing) |
| Library | Show in Haxelib Explorer, Show Project Diagram; when the library is missing also Install 'name' Using Haxelib and Install All Missing Libraries |
| Actions group | Add Action… |
| Action | Run, Set as Build Command, Add Action…, Duplicate Action…; for a custom action also Edit Action… and Remove Action (see Custom actions); for an action that launches a run configuration also Debug and Profile where available |
| Build & run | Run, Debug (for targets with a debugger), Profile (when a profiler is available for the target), Duplicate Action… |
| Run Unit Tests | Run Unit Tests, Debug Unit Tests |
| Tools group, tool | Add Tool…; on a tool also Run; for a tool you added also Edit Tool… and Remove Tool |
| Build command | Configure Build Command…, Run Build Command (when a command is set) |
| SDK | Select Haxe SDK |
| IDE Overrides and every row under it | Manage IDE Overrides… |
| IDE Overrides, its Defines row | Add Define…, Add Undefine… |
| A define override | Edit Define…, Remove Define (asks first, like the Delete key) |
Mark as Tests Build File is only offered for build files that use a supported test framework library. When exactly one profiler fits the target, Profile shows its name, for example Profile with 'profiler'. The profilers are Experimental. They and Show Project Diagram need an IntelliJ IDEA Ultimate subscription; see Profiling Overview and Libraries and Haxelib.
Related pages: Build Files, Libraries and Haxelib (installing libraries and the Haxelib Explorer), Unit Tests, Debugging Overview.
The tree updates by itself when you change something in it, when modules are added or removed, when the compilation server starts or stops and when the plugin finishes reading a Lime, OpenFL, NME or HXP project file in the background.
When you edit a build file, or a file it imports (an hxml file it names, a project file it includes), the IDE notices the change. Depending on the Sync project after changes in the build scripts option in Settings | Build, Execution, Deployment | Build Tools, it reloads the Haxe project on its own, or it shows a Sync Haxe Changes button in the editor that you click to reload. See Build Files for details.
To reload by hand:
- Reload Haxe Project on the toolbar reloads everything.
- Reload in the context menu of a build file reads that one file again and updates the module libraries.
- Purge Caches on the toolbar also throws away the cached haxelib information and the results of reading Lime, OpenFL and NME files.
If a build file you just created does not show up, click Reload Haxe Project.
While a project is not trusted, the plugin runs no code from it. It does not evaluate Lime, OpenFL, NME and HXP files, so the tree shows only what these files declare. The Compilation server row reads project not trusted — compiler evaluation disabled. Running an action or command first asks you to trust the project. When you trust the project, the plugin reloads it. See Your First Project for the trust prompt.
Getting started
Working with projects
- The Haxe Tool Window
- Build Files
- Targets and Sections
- Resolve Context
- Libraries and Haxelib
- Defines and Custom Targets
- Building and Running
- Run Configurations
- Tools
- Compilation Server
Debugging
Testing
Profiling
Editing code
- Code Completion
- Diagnostics and Inspections
- Refactoring and Navigation
- Formatting and Code Style
- Conditional Compilation
- Editor Extras
Reference