HaxeFoundation / intellij-haxe

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

Haxelib Autocomplete Instructions No workie #1140

Closed CanIGetaPR closed 6 months ago

CanIGetaPR commented 12 months ago

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 commented 12 months ago

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 commented 12 months ago

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

andreibaca commented 10 months ago

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.

m0rkeulv commented 10 months ago

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 commented 10 months ago

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

andreibaca commented 10 months ago

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.

m0rkeulv commented 10 months ago

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 commented 10 months ago

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