Skip to content

[FEATURE] Add support for import.hxc files#332

Open
KoloInDaCrib wants to merge 1 commit intoFunkinCrew:experimentalfrom
KoloInDaCrib:import-dot-eygh-ecks-see
Open

[FEATURE] Add support for import.hxc files#332
KoloInDaCrib wants to merge 1 commit intoFunkinCrew:experimentalfrom
KoloInDaCrib:import-dot-eygh-ecks-see

Conversation

@KoloInDaCrib
Copy link

Closes #329

This PR adds support for import.hxc files that add imports and usings to the modules (not to be confused with FNF Modules) that have the same or a child package. This does not add imports and usings based on the folder the scripts are in, considering scripts can be placed anywhere in a mod and have their modules loaded.

image image

@Starexify
Copy link

Starexify commented Feb 7, 2026

So checklist:

  1. What if the import.hxc is loaded AFTER the hxc scripts were initialized, would it work ?
  2. Does it use the package from the import.hxc to determine what scripts have the default imports ? (in haxe you cant do that, i'd do it using the folder location but I guess this works with the way polymod handles packages aswell)
  3. Does having a file named class-import.hxc see it as an import.hxc file?
  4. Do aliases work ?

@KoloInDaCrib
Copy link
Author

So checklist:

  1. What if the import.hxc is loaded AFTER the hxc scripts were initialized, would it work ?
  2. Does it use the package from the import.hxc to determine the package it should go in ? (in haxe you cant do that, i'd do it using the folder location but I guess this works with the way polymod handles packages aswell)
  3. Does having a file named class-import.hxc see it as an import.hxc file?
  4. Do aliases work ?
  1. Imports from both scripted classes and now import.hxc are validated after all scripts are loading, hence the code is in validateImports
  2. Yes, it uses packages. I didn't want to use folder locations because you can put scripts anywhere, as opposed to being limited to putting .hx files in the source folder of haxe projects.
  3. No.
  4. Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants