Skip to content

Custom mode syntax highlighting no longer works #57

Description

@jdewaen

Describe the bug
When adding custom mode syntax highlighting in version 5.0.0, you get the following stack trace in the browser console:

Uncaught TypeError: Cannot convert undefined or null to object
    at Object.keys (<anonymous>)
    at customModeFunction.normalizeRules (generated-flow-imports-D3QjKiXI.js:29657:18)
    at new customModeFunction (generated-flow-imports-D3QjKiXI.js:46912:12)
    at Mode.getTokenizer (generated-flow-imports-D3QjKiXI.js:30162:60)
    at EditSession.$onChangeMode (generated-flow-imports-D3QjKiXI.js:32864:32)
    at EditSession.setMode (generated-flow-imports-D3QjKiXI.js:32822:27)
    at LitAce._setCustomMode (generated-flow-imports-D3QjKiXI.js:46936:27)
    at addEventListener.once (generated-flow-imports-D3QjKiXI.js:46924:20)
    at LitAce.updated (generated-flow-imports-D3QjKiXI.js:46008:16)
    at LitAce._$didUpdate (indexhtml-Bcl_Q29S.js:7117:10)
    at LitAce.performUpdate (indexhtml-Bcl_Q29S.js:7083:12)
    at LitAce.scheduleUpdate (indexhtml-Bcl_Q29S.js:7019:25)
    at LitAce.__enqueueUpdate (indexhtml-Bcl_Q29S.js:6995:25)

No syntax highlighting happens afterwards.

Looking into this with a debugger, it seems that the states field in AceCustomMode is not being serialized. An empty object {} is passed to the addCustomMode javascript function, instead of {"states": [...]}. I believe this is related to the change to Jackson 3.
To Reproduce
Add any custom mode through the usual Java API. Open the editor. The error will appear in the browser console.

Expected behavior
Syntax highlighting should work as in previous versions

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