# Highlighting/data-language not activate for Robomind language

**URL:** <https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832>\
**Category:** v6\
**Created:** [July 22, 2026, 7:33am UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832 "2026-07-22T07:33:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janvanoorschot](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/janvanoorschot/32/5517_2.png) [@Janvanoorschot](https://discuss.codemirror.net/u/Janvanoorschot)\
**Post date:** [July 22, 2026, 7:33am UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/1 "2026-07-22T07:33:09Z")

</div>

I am the developer of RobomindAcademy, a free site teaching Computational Thinking that has been using CodeMirror for more then 10 years (dank Marijn!). Currently i am preparing a major revamp of the Academy, which includes upgrading to CodeMirror 6.

- I have created a Robomind Lezer parser including a set of tests (modelled after Marijn’s Javascript parser) that all pass.
- The Robomind language support more then 25 natural languages which are ‘dialects’ in the Lezer parser.
- A tree constructed with robomindLanguage.parser.parse(“repeat { forward }”) and examined using a cursor looks OK, including highlighting tokens.
- I created an HTML page containing a simple editor which allows dynamically switching between Javascript mode and Robomind Mode. This page and the switching works OK, however …

When switching to Javascript mode, highlighting works, and INSPECTING the ‘.cm-content’ div shows a ‘data-language=javascript’ tag. When switching to the Robomind mode, no highlighting and no ‘data-language’ tag. When in Robomind mode, the Robomind Lezer parser is called (a few well-planned console.log statements in the Lezer parser confirms this) so the mode seem to be active. There are no warnings issued in the browser’s console at any time.

I have been at this for days now, and have stripped back the code to the essentials but no luck. In a debug session the LanguageSupport/LRLanguage/LRParser blobs for Javascript look like those for Robomind although ‘context’ in LRParser is undefined.

Can anybody suggest a next course of action? I suspect the CodeMirror6 runtime rejects parts of the Robomind language support but i can not find which and why. Is there a verbose-mode i can switch on? Any suggestions? Help!

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)\
**Post date:** [July 22, 2026, 7:36am UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/2 "2026-07-22T07:36:33Z")

</div>

Are you defining highlighting tags for your language?

What does your `LRLanguage.define` call look like?

---

<div class="post-metadata">

**Author:** ![Janvanoorschot](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/janvanoorschot/32/5517_2.png) [@Janvanoorschot](https://discuss.codemirror.net/u/Janvanoorschot)\
**Post date:** [July 22, 2026, 8:28am UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/3 "2026-07-22T08:28:32Z")

</div>

FYI, i have used your lezer-javascript/lang-javascript as inspiration. I have combined them both in one module but am planning to seperate them today in lezer-robomind/lang-robomind. As extra info, the completions are working in the simple editor so something is accepted 😉

My highlight.js looks like this (as i said, stripped back to its essentials):

```auto
import {styleTags, tags as t} from "@lezer/highlight"

export const roboHighlight = styleTags({
    REPEAT: t.controlKeyword,
    repeat: t.controlKeyword,
})

```

In my index.ts i have the LRLanguage.define as follows:

```auto
let parserWithMetadata = parser.configure({
    props: [
        indentNodeProp.add({
            Codeblock: delimitedIndent({closing: "}"}),
        }),
        foldNodeProp.add({
            "Codeblock": foldInside,
        })
    ]
})

export const robomindLanguage = LRLanguage.define({
    name: "robomind",
    parser: parserWithMetadata,
    languageData: {
        commentTokens: {line: "#"},
        closeBrackets: {brackets: ["(", "[", "{", "'", '"', "`"]},
        indentOnInput: /^\s*\{$/
    }
})

export function robomind(locale = "en") {
    const lang = robomindLanguage.configure({dialect: locale}, `robomind_${locale}`);
    const completions = buildCompletions(locale);

    return new LanguageSupport(lang, [
            lang.data.of({
                autocomplete: completeFromList(completions)
            })
        ]
    );
}

```

Thanks! … Jan

---

<div class="post-metadata">

**Author:** ![Janvanoorschot](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/janvanoorschot/32/5517_2.png) [@Janvanoorschot](https://discuss.codemirror.net/u/Janvanoorschot)\
**Post date:** [July 22, 2026, 9:28am UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/4 "2026-07-22T09:28:41Z")

</div>

I am splitting the code in separate lezer-robomind and lang-robomind modules and looking at the equivalent lezer-javascript/lang-javascript i notice some rollup logic that was missing from the combined module. I will try to get the demo HTML running again and will report back.

---

<div class="post-metadata">

**Author:** ![Janvanoorschot](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/janvanoorschot/32/5517_2.png) [@Janvanoorschot](https://discuss.codemirror.net/u/Janvanoorschot)\
**Post date:** [July 22, 2026, 11:34am UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/5 "2026-07-22T11:34:20Z")

</div>

I finished splitting up the code into lezer-robomind and lang-robomind. These modules use package.json and rollup.config.js that are almost identical to lezer-javascript/lang-javascript including the use of cm-buildhelper in the lang-javascript module.

The demonstration HTML runs again using the new modules but the symptoms remain the same. Highlighting/data-language when the javascript mode is active, no-hightlighting/data-language when robomind mode is active.

The robomind parser tests OK and i made the lang-robomind module as close to its javascript brother as i can, but still no luck.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)\
**Post date:** [July 22, 2026, 12:38pm UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/6 "2026-07-22T12:38:41Z")

</div>

One issue you might be running into is duplicated packages. If you’re developing the language as a separate package with its own `node_modules` dir and then linking it into another project, that won’t work because both will be loading a different instance of `@codemirror/state` and `@codemirror/language`, and `instanceof` checks will fail.

---

<div class="post-metadata">

**Author:** ![Janvanoorschot](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/janvanoorschot/32/5517_2.png) [@Janvanoorschot](https://discuss.codemirror.net/u/Janvanoorschot)\
**Post date:** [July 22, 2026, 1:26pm UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/7 "2026-07-22T13:26:40Z")

</div>

Marijn, you are my hero for today. I indeed have three packages (lezer-robomind, lang-robomind and raeditor) that each have their own nodes\_modules. They are local and linked together using something like:

```auto
npm install --install-links=false file:../lezer-robomind

```

After your message i did the following:

1. made sure all three packages use the same versions of things like @lezer/lr. There were differences!
2. added the following line to rollup.config.js/plugins ‘resolve({dedupe: [“@codemirror/state”, “@codemirror/language”]})’
3. removed existing node\_modules and run npm install & npm dedupe

I do not know what of the three did the trick, but i now have highlighting and ‘data-language=“robomind\_en”’ in robomind mode.

I only started using npm/rollup after reading your codemirror documentation a couple of months ago so i know just enough to be dangerous. Do you have suggestions how to improve my development setup? In any case, you are my hero and thanks for the great editor. I will drop you a note when the new Robomind Academy goes life.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)\
**Post date:** [July 22, 2026, 1:52pm UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/8 "2026-07-22T13:52:11Z")

</div>

> [@Janvanoorschot](#):
>
> Do you have suggestions how to improve my development setup?

npm can be a bit of a pain to work with in setups like this. The least messy solution is probably to set up a parent ‘workspace’ project (see [these docs](https://docs.npmjs.com/cli/v7/using-npm/workspaces)) that you check out the modules into, and install all them all together with a shared node\_modules tree.

---

<div class="post-metadata">

**Author:** ![fabrizio.emer](https://discuss.codemirror.net/letter_avatar_proxy/v4/letter/f/96bed5/32.png) [@fabrizio.emer](https://discuss.codemirror.net/u/fabrizio.emer)\
**Post date:** [October 6, 2026, 9:24am UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/9 "2026-10-06T09:24:17Z")

</div>

Hi Jan,

I have just encountered what may be a related problem with the current RoboMind Academy release.

In the **“Guarding and slalom”** exercise, the simulator refuses to execute the program and the editor reports:

**“Character not allowed ‘$CHARS’ …”**

Initially I thought this might be related to the particular program:

```auto
right
forward
pickUp

```

However, I have now tested the minimal program **typed manually, character by character** :

```auto
forward

```

and I get exactly the same error.

I also reproduced the problem in **Chrome Incognito mode** , so browser extensions and the normal browser cache should not be involved.

Since `forward` is a basic valid RoboMind command, this seems to point to the editor/parser/runtime rather than to the program itself.

I found this thread because I was investigating the CodeMirror 6 / Lezer integration, and your original problem here is particularly interesting given the current 2026Q3 architecture.

**Could this possibly be related to the CodeMirror/Lezer package integration or to the runtime rejecting the RoboMind language configuration?**

I can provide a screenshot of the exact error and the URL of the exercise if useful.

Best regards, Fabrizio Emer Italy

---

<div class="post-metadata">

**Author:** ![Janvanoorschot](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/janvanoorschot/32/5517_2.png) [@Janvanoorschot](https://discuss.codemirror.net/u/Janvanoorschot)\
**Post date:** [October 11, 2026, 3:33pm UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/10 "2026-10-11T15:33:33Z")

</div>

Dear Fabrizio,

I only just saw this message … i will look into to it and get back to you.

Jan

---

<div class="post-metadata">

**Author:** ![Janvanoorschot](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/janvanoorschot/32/5517_2.png) [@Janvanoorschot](https://discuss.codemirror.net/u/Janvanoorschot)\
**Post date:** [October 12, 2026, 8:01am UTC](https://discuss.codemirror.net/t/highlighting-data-language-not-activate-for-robomind-language/9832/11 "2026-10-12T08:01:36Z")

</div>

Dear Fabrizio,

I have not been able to reproduce the error. Could you send screenshot and URL to [info@robomindacademy.eu](mailto:info@robomindacademy.eu)? Thanks you very much for your effort!

Jan
