• Stars
    star
    220
  • Rank 180,422 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 11 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Haxe plugin for IntelliJ Platform based IDEs (IDEA, Android-Studio)

Haxe plugin for Intellij IDEA and Android Studio

This plugin allows you to develop multi-platform programs using the Haxe language with Intellij IDEA, Android Studio and other IntelliJ IDEA-based IDEs by JetBrains. It requires Intellij IDEA Ultimate or Community Edition 2022.3 or later, or Android Studio 2022 or later

Technical Support

Support for this plugin is available through the project's home page: http://intellij-haxe.org, or the github issues list http://github.com/HaxeFoundation/intellij-haxe/issues.

Past Versions Announcement

Very, very few users are continuing to use this plugin with older versions of IDEA. Maintaining a code base that can compile to multiple versions is also a lot of work. its therefore been decided that from now on we will only target one version in develop branch but make maintenance branches for older versions so that important fixes can be backported.

If you for some reason need to compile one of the old versions that was part of the multi-version code base you can still find it on the legacy/develop branch.

Install

JetBrains' official plugin installation documentation is at https://www.jetbrains.com/idea/plugins/. The Haxe plugin page is https://plugins.jetbrains.com/plugin/6873?pr=idea.

To install using IDEA (from Intellij plugin repository):

Install and start IDEA. It is found at https://www.jetbrains.com/idea

If you do not have a project open in IDEA (and after first-time setup):

  • On the IDEA welcome screen, select "Configure(dropdown)->Plugins"
  • Click on the "Browse Repositories..." button.
  • Type 'haxe' to see the description for the plugin.
  • Select 'Install' to install it.
  • Allow IDEA to restart and initialize the plugin.

If you already have a project open in IDEA:

  • Open the Settings dialog (File->Settings...)
  • Highlight "Plugins" in the leftmost column
  • Click on the "Browse Repositories..." button.
  • Type 'haxe' to see the description for the plugin.
  • Select 'Install' to install it.
  • Allow IDEA to restart and initialize the plugin.

To manually install the latest or a previous Github release

Download the intellij-haxe.jar file from the release you want from Github releases. More recent releases have begun to be named intellij-haxe-<release>.jar, where <release> is the version of Idea for which the Jar is built. (e.g. intellij-haxe-2022.3.jar) Make sure that you pick the proper one for your release. A message should pop up and warn you if a release is incompatible.

If you do not yet have a project open in IDEA (and after first-time setup):

  • On the IDEA welcome screen, select "Configure(dropdown)->Plugins"
  • Click “Install plugin from disk...”
  • Select the “intellij-haxe.jar” file you downloaded
  • Allow IDEA to restart and initialize the plugin.

If you already have a project open IDEA:

  • Open the Settings dialog (File->Settings...)
  • Highlight "Plugins" in the leftmost column
  • Click “Install plugin from disk...”. On 2019.x versions or later, click on the settings (gear) icon to see the "Install from disk..." menu item.
  • Select the intellij-haxe-<version>.jar file you downloaded
  • Allow IDEA to restart and initialize the plugin.

Build

Note that installation as described above installs a fully built version of the plugin (the .jar file). Most users do not have to build the product for themselves. This section is for those who like to dig a little deeper.

This describes the command line build. To build from within Intellij IDEA itself, see the contributing document to setup your development environment. Much more detail is provided there for command line build options as well.

Dependencies

  • OpenJDK 17
  • A windows command prompt or bash compatible shell

Build command

Windows

gradlew.bat clean build verifyPlugin 

Mac/Linux

./gradlew clean build verifyPlugin 

NOTE: You can run the build without tests by substituting build with buildPlugin on the lines above

This will generate a intelllij-haxe-<release>.jar file at the root of the project that you can then install from disk (see “Install the latest or a previous Github release).

Note that the first time you build the project Gradle will download the requested version of IntelliJ Ultimate and any other other dependencies. This can be quite slow at times and prone to failure. For repeated building and testing, we recommended that you set up your machine as described in the contributing document.

Test

Dependencies

Same as for build.

Test command

Windows

gradlew.bat test

Mac/Linux

./gradlew test

This will build and run the tests and display the JUnit report.

Use the hxcpp debugger

NOTE: IDEA Community Edition currently will not start an IDE-based debugging session. For that, IDEA Ultimate is required. Command-line debugging is available because that is a feature of the Haxe language itself. See the hxcpp-debugger project for more information.

The hxcpp debugger functionality conforms to the Haxe v3.0 debugger. In order to use this, you must:

  • Install the VERSION 1.1 debugger haxelib from https://github.com/HaxeFoundation/hxcpp-debugger/tree/protocol_v1.1. The hxcpp-debugger that is installed via 'haxelib install' is generally not the latest or best working version. (The Haxe Foundation maintainers do not release regular updates for it). Instead, get the current sources locally: Install git and clone the repository from http://github.com/HaxeFoundation/hxcpp-debugger and install via

    haxelib git hxcpp-debugger <your_local_clone> protocol_v1.1
    

    Then, you'll have the version that matches the plugin. Whenever you need to update the debugger to the latest sources, do a 'git pull' and then rebuild your app.

  • Re-build your project using this newest debugger haxelib.

  • Configure your haxe program to start the debugger when the following command line option is provided:

    -start_debugger
    

    If you expect to do remote debugging, you'll also have to support:

    -debugger_host=[host]:[port]
    

    Most likely you'll just want to add the following in your main() when -start_debugger is set:

    new debugger.HaxeRemote(true, host, port);

    Generally speaking, the build/debug configuration (Run->Edit Configurations) is set up to use port 6972, so you can probably cheat and use:

    new debugger.HaxeRemote(true, "localhost", 6972);

    However, the line has to match your debug settings. Fortunately, they are passed to your program on the command line. Notice the "-start_debugger -debugger_host=localhost:6972" passed to haxelib:

    C:/HaxeToolkit/haxe/haxelib.exe run lime run C:/temp/issue349/openfl_cpp_debug/openfl_cpp_debug/project.xml
      windows -verbose -Ddebug -debug -args  -start_debugger -debugger_host=localhost:6972
    

Your program should now:

  1. Look for the '-start_debugger' parameter before doing anything. It won't be there if the program is being started via the "Run" command from IDEA.
  2. Parse the '-debugger_host=' parameter. If it exists, then a remote controller (e.g. IDEA) will be trying to connect on that port. If it doesn't exist, then the user (you) probably want to start the command line debugger:
new debugger.Local(true);

Here's a snippet you can use: (Thanks to @isBatak)

#if (debug && cpp)
  var startDebugger:Bool = false;
  var debuggerHost:String = "";
  var argStartDebugger:String = "-start_debugger";
  var pDebuggerHost:EReg = ~/-debugger_host=(.+)/;

  for (arg in Sys.args()) {
    if(arg == argStartDebugger){
      startDebugger = true;
    }
    else if(pDebuggerHost.match(arg)){
      debuggerHost = pDebuggerHost.matched(1);
    }
  }

  if(startDebugger){
    if(debuggerHost != "") {
      var args:Array<String> = debuggerHost.split(":");
      new debugger.HaxeRemote(true, args[0], Std.parseInt(args[1]));
    }
    else {
      new debugger.Local(true);
    }
  }
#end

Contribute

See the contributing document.

More Repositories

1

haxe

Haxe - The Cross-Platform Toolkit
Haxe
6,166
star
2

hashlink

A virtual machine for Haxe
C
810
star
3

neko

The Neko Virtual Machine
C
553
star
4

hxcpp

Runtime files for c++ backend for haxe
C++
297
star
5

hscript

Parser and interpreter for Haxe expressions
Haxe
262
star
6

HaxeManual

The official Haxe manual
Haxe
218
star
7

as3hx

Convert AS3 sources to their Haxe equivalent
Haxe
174
star
8

haxelib

The Haxe library manager
Haxe
172
star
9

hxnodejs

Haxe externs for working with node.js
Haxe
171
star
10

dox

Haxe documentation generator.
Haxe
146
star
11

format

Various files formats support for Haxe
Haxe
131
star
12

code-cookbook

The Haxe Code Cookbook - A community driven resource website for learning Haxe in practise
Haxe
112
star
13

haxe-evolution

Repository for maintaining proposal for changes to the Haxe programming language
111
star
14

haxe.org

The haxe.org website
HTML
81
star
15

haxe-markdown

A Markdown parser in Haxe.
Haxe
63
star
16

hxcs

Haxe C# support library. Build scripts and support code.
Haxe
57
star
17

record-macros

Macro-based ORM (object-relational mapping)
Haxe
49
star
18

hxcpp-debugger

Cross-platform debugger for hxcpp
Haxe
49
star
19

crypto

Cross platform cryptographic functions for Haxe
Haxe
48
star
20

npm-haxe

Install Haxe using Node Package Manager aka npm
JavaScript
46
star
21

hxjava

Haxe Java support library. Build scripts and support code.
Haxe
46
star
22

tora

NekoVM Application Server
Haxe
30
star
23

docker-library-haxe

Docker official image for Haxe
Dockerfile
28
star
24

ocamllibs

Various OCaml Libraries
OCaml
24
star
25

Project-Management

Project management and communication
20
star
26

haxedevelop.org

Website content and sources
Haxe
19
star
27

try.haxe.org

run Haxe code snippets in your browser
Haxe
18
star
28

hx3compat

Haxe 3 compatibility lib for Haxe 4
Haxe
16
star
29

html-externs

HTML externs for Haxe
IDL
15
star
30

hxnodelibs

Haxe
14
star
31

ocamhaxe

OCaml distribution for Haxe compilation
Haxe
11
star
32

haxe-debian

Debianizing Haxe
Haxe
11
star
33

api.haxe.org

Haxe API documentation
Haxe
10
star
34

hxgithub

Haxe
8
star
35

haxe-terraform

Haxe Foundation infrastructure
HCL
5
star
36

nekovm.org

The website for NekoVM.
Haxe
5
star
37

neko-debian

Debianizing Neko
C
4
star
38

build.haxe.org

Snapshot build storage web UI
Haxe
3
star
39

hx4compat

Haxe 4 compatibility lib for Haxe 5, or maybe the other way aroun?
Haxe
3
star
40

haxe.org-comments

Repository to collect comments of our haxe.org websites
2
star
41

hashlink.haxe.org

HTML
2
star
42

homebrew-haxe

Haxe formulae for the Homebrew package manager
Ruby
1
star
43

summit.haxe.org

Haxe
1
star
44

haxe-deps

A luarocks spec for the dependencies required for the Haxe Lua target
Lua
1
star
45

haxe-choco

Chocolatey Haxe package
Haxe
1
star