0xPolygonMiden / examples

Examples of using Polygon Miden
MIT License
18 stars 18 forks source link

Add syntax highlighting to the CodeEditor #91

Closed Dominik1999 closed 2 months ago

Dominik1999 commented 1 year ago

We can add syntax highlighting to the code editor for MASM.

Here is a Miden Assembly extension for VScode. I think, we can reuse them for the CodeMirror. But I am not 100% sure. Here is some info https://codemirror.net/docs/ref/#language.syntaxHighlighting

kaushalbhardwaj commented 4 months ago

Solutions experimented:

Tried to use the existing VS Code extension repo and the masm.tmLanguage.json file for the language's grammar in syntax highlight of the CodeMirror package. But unable to generate the lezer grammar or unable to convert the text grammar into lezer grammar. Link to masm file

Tried to use language support from code mirror for similar language but neither x86 nor assembly language was available here.

Finally used the C language from legacy-modes for the support and it works well for our case.

The only improvement we can make is adding language grammar but not a necessity. The current one also works well.

Dominik1999 commented 4 months ago

Then let's use the current solution for now. I will check it out in your PR