MikeBeller / janet-playground

A WebAssembly based playground for Janet a la play.golang.org
MIT License
9 stars 2 forks source link

Formatting, syntax highlighting, and parenthesis checking #3

Open MikeBeller opened 3 years ago

MikeBeller commented 3 years ago

Janet-playground should support at least some level of syntax-aware editing. At a minimum it should be possible to click "format" to format the code, and when typing a ) the matching ( should become highlighted. At a maximum, full syntax-aware editing could be implemented.

Possible approaches that have been suggested:

pepe commented 3 years ago

Just by looking at the front page of ace, there is the option to import .tmlanguages, for which exists generator in Janet https://github.com/janet-lang/janet/blob/master/tools/tm_lang_gen.janet.

And ace looks OK.

MikeBeller commented 3 years ago

Ah -- thanks @pepe! I will check it out.

MikeBeller commented 3 years ago

Syntax highlighting and parens matching added. I just used clojure mode as a quick fix (because it looked much easier than tmlanguage integration). I will leave this issue open because what is there is not perfect clearly.