kaitai_struct_webide icon indicating copy to clipboard operation
kaitai_struct_webide copied to clipboard

`-webide-representation` key not working for imported types

Open Mingun opened this issue 1 year ago • 1 comments

I define two KSY files in WebIDE:

meta:
  id: int
  endian: be
  encoding: ASCII
types:
  int:
    -webide-representation: "{value:dec}"
    seq:
      - id: raw
        type: str
        size-eos: true
    instances:
      value:
        value: raw.to_i
  hex:
    -webide-representation: "{value:dec}"
    seq:
      - id: raw
        type: str
        size-eos: true
    instances:
      value:
        value: raw.to_i(16)
meta:
  id: imports
  imports:
    - int
seq:
  - id: field1
    type: int
    size: 2
  - id: field2
    type: int::hex
    size: 2

However, -webide-representation key not taken into account in the results: Kaitai Web IDE

Mingun avatar Sep 01 '22 08:09 Mingun

Yes. https://github.com/kaitai-io/kaitai_struct_webide/pull/122 attempted to fix it, but I had to revert it because it broke absolute imports.

generalmimon avatar Sep 01 '22 09:09 generalmimon