HeapsIO / heaps

Heaps : Haxe Game Framework
http://heaps.io
MIT License
3.22k stars 341 forks source link

Res not updating when folder is outside project root #644

Open Yanrishatum opened 5 years ago

Yanrishatum commented 5 years ago

Case: Source code is located at C:/.../project res folder is located in shared folder: D:/.../Shared/project/res Path to it is specified via -D resourcesPath=... Whenever new files are added - completion does not update to account for them, requiring restarting completion server or recompilation. VSCode/Haxe4-rc3 I suspect this is caused precisely because folder it outside of completion server watch scope and have nothing to do with Heaps, but still wanted to note it. Is it possible to tell compiler to invalidate macro completion cache for external resource change?

ncannasse commented 5 years ago

@Gama11 @Simn any idea ? (I'm using haxe.macro.Context.registerModuleDependency)

Gama11 commented 5 years ago

Interesting, I didn't know that registerModuleDependency() works on directories too..

Vshaxe disables module checks, and then uses VSCode file watcher events to notify Haxe about changes. However, the file watcher obviously only listens to .hx files, I wonder if Haxe skips checks for non-hx files as well...

Yanrishatum commented 5 years ago

As long as res folder is inside VSCode workspace - completion updates just fine. E.g. C:/.../project/res - works as expected and completion updates when new files are added. Actually, I should check if I still can reproduce it if I'll add the shared project folder (for builds and resources) as multi-folder workspace in VSCode.

nachoverdon commented 5 years ago

You can try a symlink as a temporary workaround