Generating languages for Monarch / Monaco Editor #1761
Replies: 6 comments 3 replies
-
Example of the structure to avoid clicking a link ^_^ This is the javascript language definition
|
Beta Was this translation helpful? Give feedback.
-
Dig dig dig..... THEY ALREADY HAVE A TYPE FOR IT 😁 |
Beta Was this translation helpful? Give feedback.
-
Sounds like a nice idea, but I think that would be an immense task. I am in the middle of implementing a language service with Monaco integration and the parser (of course written with Chevrotain) is just a little part of it. Even for just generating the Monarch file a lot of metadata is missing that would be needed to be attached to the parser somehow. In the end, I guess you would be attaching so much metadata to your parser that you could have written the Monarch configuration itself (and that's just the Monarch part). When adding validation and auto-completion there is additional stuff that is very much dependent on your language. And then there is also that web worker stuff for the Monaco integration. As a reference, if you want to build a language service and Monaco integration yourself I can recommend the below resources. It's the easiest I found, but uses a handwritten parser: Another good example of a language service that uses Chevrotain is https://github.com/SAP/xml-tools. |
Beta Was this translation helpful? Give feedback.
-
I have started plodding down the path, just to see where it takes me.... I was able to copy an example from their site and made a little wrapper for customizing.... |
Beta Was this translation helpful? Give feedback.
-
For writing language servers you may want to have a look at Langium Incidentally it is using Chevrotain under the hood 😄 |
Beta Was this translation helpful? Give feedback.
-
What do you think about using a defined language in Chev and generating an object that would work when plugged into here...???
I swapped the editor on my playground from CodeMirror to Monaco and was wondering how hard it would be to make something similar to the
d.ts
generator but to generate an object with the structure that would seamlessly work to highlight (and even semantically check????) my language? 🤯 ????Just wondering if this is far fetched / contrived or if maybe an easy task.....
Beta Was this translation helpful? Give feedback.
All reactions