Syntax highlighting?

Where are we at on the syntax highlighting? @glennj @ghaberek @petelomax @ErikSchierboom (just pulling you all in here by way of attempting to coordinate)

We should certainly wait on Jq syntax highlighting - #10 by dem4ron

Gimme a couple of days to fix something in If you can Amazingly I have somehow actually built Phix highlightjs, a process which has utterly defeated me for more than a year, so you might be able to use that as-is for Euphoria, or at least use it as a decent starting point.

1 Like

@ErikSchierboom how do I get Pete’s work into play?

Of course the other challenge is getting highlighting into the text-editor.

Be advised joshgoebel (Josh Goebel) · GitHub is currently looking at this hjs-side, see Phix by petelomax · Pull Request #3728 · highlightjs/highlight.js · GitHub now merged into main

1 Like

I’ll have a look tomorrow

@axtens @petelomax The GitHub - highlightjs/highlightjs-phix: Highlight.js Grammar for Phix library needs to be published to NPM before you can use it for the euphoria track. That’s something @petelomax will need to do.

So what’s the situation with CodeMirror regarding Euphoria? Is this something else we need to address?

I don’t think there is a CodeMirror package for Euphoria, so that would have to be created (please double check if it isn’t there yet).

As far as I can tell, there’s nothing. Who’s the local expert? Where do I start? Where’s the documentation?

I’ve created highlightjs-phix - npm (my first ever!)

1 Like

CodeMirror Language Package Example I don’t think we have an existing expert (I might be mistaken).

Hmm … a bit beyond my skillset at this point in time. Anyone else? @glennj @ghaberek @petelomax @BNAndras ?

No thanks. I’ve got my hands full at the moment. I do need to look into CodeMirror for the Pyret track, but it’s a low priority for me.

2 Likes

After hitting a quite ludicrous number of dead ends, I finally managed to squeeze a tiny bit of one of my little toes in the door, but I’m still completely stumped, and have asked for some help on SO:

1 Like

Have you asked ChatGPT? Here’s what it says when I ask - I imagine you can continue with the conversation to get a good understanding :slight_smile:

Unfortunately stack overflow has gotten pretty unforgiving (some would say hostile) to open ended “how do I …” questions like that. I highly doubt you’ll get any useful answers there.

I did find a similar question from 2010: How to add syntax highlighting for a new language in codemirror? - Stack Overflow – the answer is basically “RTFM”

Nice try, sadly those instructions are woefully out of date and I ended up blocked at:

Uncaught TypeError: Failed to resolve module specifier “@codemirror/state”. Relative references must start with either “/”, “./”, or “…/”.

I had another go, hit another brick wall, and got what I consider a frankly rather bizzare reply:

One more try (previous question closed as “not focussed enough”…)

I’ve completely given up on cm6, but put up a cm5 demo:
Syntax Highlighting With CodeMirror 5 - I dunno if it’s me but it often locks up when I try, if I close the page and try again it’s fine.

2 Likes

Looks good. Works good. So what’s the difference between CM5 and CM6?