-
Notifications
You must be signed in to change notification settings - Fork 63
Description
It seems that using imports within the webIDE, where the desired file is nested in a folder, causes an error whereas it otherwise works on the compiler interface. For example:
meta:
id: test
file-extension: test
imports:
- something
seq:
- id: dummy
type: somethingwill work fine, provided that a something.ksy file exists which provides the type something.

However,
meta:
id: test
file-extension: test
imports:
- something
- another/another
seq:
- id: dummy
type: something
- id: dummy2
type: anotherwill provide the unclear error "Cannot read properties of null (reading 'indexOf')" as it gets a null value back from resolving another/another, even if the file another/another.ksy provides the type. Instead, it seems that the directory structure is flattened for localfs, and the file is retrieved via just another.

This unclear "cannot read properties of null" error will get emitted if you import any nonexistent file (e.g. kaitaiIde.app.compilerService.jsImporter.importYaml('garbage/path', 'rel')) and should be replaced with a more clear indication. Further, if directories are supported in the UI, those directories should be respected in the fs lookups, rather than replacing them with a flattened copy.
This is loosely documented in #30, but I wanted to re-draw attention to it with a more aptly named issue since it's still an open limitation (from 7 years ago).