2024-02-21: Web IDE improvements

The Web IDE at https://ide.kaitai.io/devel/ has recently seen a number of improvements! They address a few common issues and imperfections of the Web IDE you may have encountered.

These improvements were made thanks to the financial support from the NLnet Foundation.

Partial object tree in case of an error

The new feature we’re most excited about is the ability to show partial results in the object tree even if the parsing failed (as suggested in #156). Previously, a parsing error caused that only the error message was shown, while the object tree still displayed the last successful parsing. This meant you were left with the little information contained in the error text when trying to figure out what caused the problem. Considering the complexity of binary formats, this is often impossible — for efficient debugging you need as much context as possible, which includes the values of all fields parsed before the error occurred.

That’s exactly what this feature gives you. On top of that, it uses several icons to indicate which fields are incomplete, which helps you pinpoint the exact location of the error. Hover over the icons for more information on what each icon indicates.

The following screenshots show what it looks like in action. In the first example below, the parsing was interrupted by an EOF error, as stated in the “Errors” pane at the bottom. The object tree displays all fields up to the source of the EOF error. We can see two types of icons: the yellow warning triangle and a red circle with an exclamation mark. The yellow warning triangle warns us that even though the object has some content, its parsing was interrupted due to an error, so some fields may be missing. The red circle with an exclamation mark indicates a field that has no value, because its parsing failed. Therefore, it is usually the source of the parsing error.

Screenshot of the Web IDE object tree with partial results until an EOF error occurred

In the second example below, we can see a new icon: a cross mark. It indicates a failed field validation. The field was parsed fine, but the parsed value violates the field’s contents or valid constraint as defined in the .ksy specification (see sections 4.3 and 4.4 in the User Guide for explanation of these keys). Therefore, a validation error was thrown and no more fields were parsed.

We can also notice the same circle with an exclamation mark icon as before, but this time in blue. Blue icons only appear for instances and indicate that this instance was not invoked from the .ksy specification itself, but was first invoked explicitly by the Web IDE when displaying the object tree and this invocation raised an error.

You can display the full error message in the “Errors” pane by selecting a field with a cross mark or any blue icon.

Screenshot of the Web IDE object tree with partial results up to a validation error

Other improvements

This was perhaps the most visible change, but not the only one!

Other improvements include:

Final word

Head over to https://ide.kaitai.io/devel/ and try it out for yourself!

If you find any issues, please report them to the Web IDE issue tracker so we can fix them in the future.