HaxeFoundation / intellij-haxe

Haxe plugin for IntelliJ Platform based IDEs (IDEA, Android-Studio)
http://intellij-haxe.org
Apache License 2.0
222 stars 100 forks source link

Doesn't work in 2019.2.3 #970

Closed bronze7 closed 4 months ago

bronze7 commented 4 years ago

I installed the plugin for version 2019.2.3 and it doesn't work. It doesn't recognize the imported libraries so ended up not recognizing most of the code. I created the project SDK and linked the path to Haxe folder but doesn't work out. If it's not supported for this version then it's my fault. I went ahead because it said that the plugin supports version 2019.x.

EricBishton commented 4 years ago

Imported libraries usually need to be pointed at their "classpath" directory, specified in the libraries haxelib.json file. For example, the library classpath for hx3compat is .../haxelib/hx3compat/1,0,3/std, and the classpath for hxcpp is .../haxelib/hxcpp/3,4,188/src. Heaps, openfl, and lime use their libraries root directories (e.g. .../haxelib/lime/9,5,1).

For the SDK, the classpath and sourcpath should each have only one entry, at it should point to the "std" subdirectory of the SDK.

bronze7 commented 4 years ago

Imported libraries usually need to be pointed at their "classpath" directory, specified in the libraries haxelib.json file. For example, the library classpath for hx3compat is .../haxelib/hx3compat/1,0,3/std, and the classpath for hxcpp is .../haxelib/hxcpp/3,4,188/src. Heaps, openfl, and lime use their libraries root directories (e.g. .../haxelib/lime/9,5,1).

For the SDK, the classpath and sourcpath should each have only one entry, at it should point to the "std" subdirectory of the SDK. IntelliJ has automatically set the sourcepath and classpath to the correct location. In the File>ProjectStructure>SDK I have checked that the correct location is given.

As for the libraries part, I'm not quite understanding. Where can I find the haxelib.json file.

Another thing I noticed is that the IDE is asking me to specify my project path in package ; like Folder.SubFolder.source

EricBishton commented 4 years ago

Where can I find the haxelib.json file.

The haxelib.json file for each library is in the library's root directory: .../haxelib/hxcpp/3,4,188/haxelib.json.

If it has a "classpath" entry, then you must add that path to the library's root directory. If there is no "classpath" entry, then the root directory itself will suffice.

... the IDE is asking me to specify my project path in package ;

If your project is set up incorrectly, the expected package name will be incorrect. In the "Project Structure...->Modules (left panel)->(middle panel)->Sources(tab)", make sure that your source root(s) is(are) marked as "sources". Generally speaking, your project root should not be considered a source directory; your .../src directory should. The package detection mechanism will suggest (and expect) a path from one of these roots (the root name is not included).

For example, if you have a file in the .../myProject/src/foo/ directory named bar.hx, and you have set the project root to.../myProject/src/, the expected package entry in the bar.hx file would be package foo;

image

bronze7 commented 4 years ago

The classpath and sourcepath is set to "..\haxe\std". The module shows my source root as my src folder. Also the Haxe SDK is named Haxe NA (NA) (as in Not Available?). Setting the module helped removing the error on the package ; line but still classes, functions and variables are not identified by the IDE.

EricBishton commented 4 years ago

Please either send your project files (.ipr and .iml) or a screenshot of the SDK configuration settings page, the module page, and the project page. Also, please tell me the absolute paths of your project and the Haxe SDK on your computer.

If the SDK is "Haxe NA" it means that the plugin couldn't find (or didn't have permissions to run) the Haxe executable (Haxe.exe on Windows) in order to extract the version information. Of course, after you fix the SDK, the name won't change unless you change it manually; it is only detected when the SDK is first set up.

bronze7 commented 4 years ago

Sure. classpath sourcepath source

Haxe toolkit is installed in D:\SDK\Haxe\Haxe 4\haxe\std.. My project is in D:\Projects\Games\Haxe\MyGame.. as you can see from the image

CanIGetaPR commented 4 months ago

Suggesting this issue is closed as it was most likely caused by misconfigured class library paths and is related to a 5 year old IDE version.