Configuration

Jens Fischer edited this page Aug 22, 2018 · 26 revisions

The vshaxe extension supports the following settings. They can be configured in user or workspace settings file (.vscode/settings.json):

Feature-specific configuration

For configuration of specific features, please refer to their respective sub-pages:

Haxe Executable

You can change the executable used for Tasks and the display server with the "haxe.executable" setting:

"haxe.executable": "C:\\HaxeToolkit\\haxe\\haxe.exe"

You can also have more complex settings that include environment variables or OS-specific properties:

"haxe.executable": {
    "path": "haxe", // path to the executable (default: `haxe`)
    "env": { // environment variables for Haxe
        "HAXE_STD_PATH": "/some/path",
        "SOME_VAR": "some_value",
    },
    // platform-specific overrides of the keys above
    // they will be merged into the default configuration
    "windows": {},
    "linux": {},
    "osx": {}
}

Display Configurations and Display Server

{
    "haxe.displayConfigurations": [ // one or more configurations for the haxe completion server
        ["-cp", "src", "-js", "main.js"], // a configuration is array of arguments passed to the completion server
        ["build.hxml"], // hxml file is a normal Haxe argument too
    ],
    "haxe.displayServer": { // configuration for starting haxe completion server itself
        "arguments": ["-v"], // arguments before --wait (-v is useful for debugging)
    }
}

Beware that display configurations specified in "haxe.displayConfigurations" should only contain arguments suitable for completion, such as -cp, -lib, -D and target output (-js, -cpp, etc.). This is particularly important when specifying an .hxml file for completion: make sure it doesn't contain --next, --each and other arguments not suitable for completion.

Multiple Display Configurations

Multiple display configurations are useful when working with a codebase that is meant to be compiled for different Haxe targets, or with a different set of defines. If there is more than one configuration provided in the "haxe.displayConfigurations" setting, when a .hx file is open, a selection appears in the status bar allowing to switch current display configuration:

The same menu can also be shown by using Haxe: Select Configuration command from the command palette or a keybinding.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.