WurstScript icon indicating copy to clipboard operation
WurstScript copied to clipboard

Errors from dependency sources get ignored until edit..

Open Frotty opened this issue 7 years ago • 2 comments

.. and then cause "import C could not be found in Y" errors. Even though the package clearly exists:

The problem is that MapBounds contains an error, which doesn't show up even if you open the file, until you edit it.

If the error is an ANTLR error, the package cannot get parsed and thus imports fail.

The dependency errors should be shown beforehand imo and maybe improve the import error to detect existing, but erroring packages.

Frotty avatar Sep 12 '18 16:09 Frotty

My initial (wrong) assumption was, that you only use correct dependencies.

How should we fix it?

a) Load all sources including dependencies at startup (=> increased RAM usage and startup time) b) Load dependency source when file is opened. c) Load dependency source when a package with same filename is imported somewhere. e) When compiling dependencies add a file that says "these sources have hash X and no compilation errors". Then check hash to validate that dependencies are correct.

peq avatar Sep 17 '18 19:09 peq

where is option d) ? 🔸 I think the e) solution sounds good. Probably that file should even be generated by the setup/DM when updating the dependency? Wurst should just parse files with different hashes once detected. I suppose in general it is not advisable to modify dependencies, but it can be a big timesaver, if I find a bug or so while working on a project that uses my own dependency.

Frotty avatar Sep 21 '18 14:09 Frotty