Restore ABAP syntax highlighting in CodeMirror

I noticed that ABAP currently doesn’t have syntax highlighting in the CodeMirror editor on Exercism.

I took a look at how the website handles the other CodeMirror languages and put together a small local ABAP mode using @codemirror/language 's StreamParser . This avoids adding another npm dependency and fits into the existing language compartment setup.

I also added a small regression test for the ABAP language mapping.

I tested it with:

  • Focused Jest tests: 3/3 passing
  • Production build: passing
  • Prettier: passing
  • git diff --check : passing

I opened a PR for it (#10036), but it was closed, so I figured I’d ask here before trying another approach.

Is a small local CodeMirror mode like this something that would be acceptable for Exercism? Or is there a preferred way to handle syntax highlighting for languages that don’t already have a suitable CodeMirror package?

The implementation is intentionally pretty small — just syntax highlighting, not a full ABAP parser or semantic analysis.

Any pointers on the preferred direction would be appreciated.

https://exercism.org/docs/building/tracks/new/syntax-highlighting/dynamic
This likely should involve a track maintainer.

It’s also the website repo so Exercism staff would need to sign off on doing this. We make a generic-codemirror-lang repo template available, and eight tracks have made their own CodeMirror repos under the Exercism banner. So the precedent is to do this outside the website repo.

If the ABAP maintainers do want dynamic syntax highlighting, I’d recommend having Erik (or Glenn?) create a codemirror-lang-abap repo from the generic template. That’s a repo the maintainers then can control and update much easier.

:slight_smile: gree. If you bundle it as language dep, we’ll happily include it. I’ll let @glennj try and make the repo and see if that works! :)

1 Like

@iHiD https://github.com/exercism/maintainers-admin-tools/pull/11

1 Like

@hawaka6667-dev The ABAP codemirror repo has been created:

1 Like