Need help in defing custom language #3874
-
Hello everyone, I am new to monaco and I'm having trouble implementing my custom language for a project. I would greatly appreciate some help. The format of my language is as follows:
I have already created an array of keywords ["POST", "GET", "PUT", "DELETE", "HEAD"] for the HTTP methods. The EndPoint will look something like [collections/startups/points , collections , collections/demo1/points , collections/startups/points]. The {json Payload} part will be optional as per the user's needs. I am having trouble figuring out how to add custom error checking and auto-completion. I want to be able to check the first word (the HTTP method) and the second word (the endpoint) for unexpected letters and support separate arrays for auto-completion. Additionally, I would like to have a different feature for autocompletion in the JSON body. Any guidance or advice on how to approach this would be greatly appreciated. Thank you in advance! current code (for setMonarchTokensProvider )
for auto-complete
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can add error underline by markers. Generally, you should create AST parser to provide rich language support. |
Beta Was this translation helpful? Give feedback.
You can add error underline by markers.
Please see example
Generally, you should create AST parser to provide rich language support.
https://en.wikipedia.org/wiki/Abstract_syntax_tree