intellij-haxe icon indicating copy to clipboard operation
intellij-haxe copied to clipboard

Haxelib Autocomplete Instructions No workie

Open CanIGetaPR opened this issue 2 years ago • 8 comments

I tried to follow these instructions:

Auto Complete For Haxelibs

    Navigate to File -> Project Structure -> Modules -> Dependencies
    Click the + to Add a new Library of type Haxe.
    Select the folder that contains haxelib.json

For example, to enable auto complete for OpenFl 9.0.2, the folder with haxelib.json is located at HaxeInstallPath/haxe/lib/openfl/9,0,2 

Unfortunately they don't work.

Work-around:

Auto Complete For Haxelibs

Navigate to File -> Project Structure -> Modules -> Dependencies
Click the + to Add a new Library of type Haxe.
Select the folder that contains the top level source packages
If IDEA can't determine what kind of files the chosen item contains, choose Library Classes
For configure choose Project Library.

For example, to enable auto complete for OpenFl 9.3.2, the folder with the top level source packages is located at HaxeInstallPath/haxe/lib/openfl/9,3,2/src

CanIGetaPR avatar Nov 21 '23 02:11 CanIGetaPR

Whoops I was looking at the master branch and funnily enough those were some instructions I created too!

https://github.com/HaxeFoundation/intellij-haxe/commit/5eb82c1197216e84be6217c948fa5b32a25c047e

CanIGetaPR avatar Nov 21 '23 02:11 CanIGetaPR

Is this way I found the correct way for adding haxelib auto complete or is there a better way?

CanIGetaPR avatar Nov 21 '23 02:11 CanIGetaPR

I can confirm this issue and it's not only autocomplete it does not see the imported classes at all. The workaround seems to work. But for me this issue exists only with newer libraries. Older openfl and flixel libraries seem to work as before.

andreibaca avatar Dec 25 '23 07:12 andreibaca

i would recommend using a build system file instead of manually adding libs, it could be that the auto import from the build systems part of the code cause some issues or some of the resent changes in intellij. ill have to do some debugging to figure out why manually libs are not not added correctly to the project.

m0rkeulv avatar Dec 26 '23 15:12 m0rkeulv

when adding libraries manually, are you sure you added the paths as Classesand not Sources ? i can reproduce the problem by only adding sources and not classes. image

m0rkeulv avatar Dec 26 '23 20:12 m0rkeulv

Usually I am adding both classes and sources. image

Regarding the build system file. I am using openfl that builds with lime so I am using Project.xml for project setup. Never built a haxe project differently - so I don't even know how to do it.

An important detail - I am using lix to manage haxe versions and libraries.

andreibaca avatar Jan 02 '24 08:01 andreibaca

not sure how lix handles things, with haxelib all you really need to do is add the project XML and intellij would detect and setup things for you. image

but if you want to use lix i guess you will have to add them manually, make sure gobal libs are also added to your modules dependencies. image

m0rkeulv avatar Jan 02 '24 09:01 m0rkeulv

I did some manual testing, and while the GUI was a bitt buggy with global lib names it should work just fine adding libs manually. image

image

image

m0rkeulv avatar Jan 02 '24 10:01 m0rkeulv