Skip to content

WebIDE does not support subdirectory imports #172

@kendallgoto

Description

@kendallgoto

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: something

will work fine, provided that a something.ksy file exists which provides the type something.
image

However,

meta:
  id: test
  file-extension: test
  imports:
  - something
  - another/another
seq:
- id: dummy
  type: something
- id: dummy2
  type: another

will 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.
image

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions