How do I additional libs for VsCode code paths?


I added the Haxe extension for VsCode. How do I add additional Haxe libraries (that might have custom locations) to a VsCode project so that I can access the code implementations or help/syntax highlighting etc?


No one needs to this type of stuff? Basically I want to add the hxgodot generated bindings in my project to autocomplete and code access.

You can use libraries from Haxelib by adding the -lib compiler option to your .hxml file.

If you have directories of source code that you’d like to reference, you can use the -cp compiler option in the .hxml file.

-lib libraryname
-cp path/to/src
1 Like

To install a library with vshaxe, you can follow these steps:

  • Open the Explorer pane
  • Find the Haxe Dependencies tab (at the bottom of the Explorer pane)
  • Click on the toolbar icon Install Library
  • Choose the library source, the default is haxelib
  • Enter the name of the library
1 Like

Thanks for the replies.

I am not trying to compile with any additional libraries oor install new ones, I just need these as code reference/autocompletion/docstrings inside VsCode while my project is open. See GitHub - HxGodot/hxgodot: A Haxe GDExtension for Godot 4 It installs as library but it generates Godot related binding codes inside my project not inside the haxe library folders. Not sure if we are talking about the same thing.

It generates Haxe code? If that’s the case, then it sounds to me like you want the -cp compiler option, which I mentioned above.

Sure but how doe s the “-cp” option will help with autocomplete in VsCode? Is the compiler feeding those libs back to VsCode? I am not really sure how that would work out.

Yes, the Haxe VSCode extension works together with the Haxe compiler to provide code intelligence.

1 Like

Thanks, I will give it a go