-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rego support #2624
Add rego support #2624
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @JordanSh!
You seem to have implemented a subset of Rego. I.e. several keywords and features like raw strings are missing. Unfortunately, this means that the language definition will highlight a lot of relatively easy Rego code incorrectly. It also has a few errors (e.g. package
and some
are keywords and strings that contain a #
will be highlighted incorrectly.)
I know that creating Prism language definitions isn't easy, so I want to ask whether you want to add all the missing features and fix the errors yourself or should I do it? Rego has excellent documentation, so I can make a language definition for it rather quickly. So would you like to make you a PR to your branch with all the fixes and additions?
i will try to handle this asap, in case i'll get stuck i'll let you know |
Sorry for the late notice @RunDevelopment. I would like to request for the help you offered to finish this PR. let me know if that would be possible and if I can provide help of any kind. |
Sure thing! I will directly commit to this branch if that's alright with you.
If possible, I would like you to test/review my changes. I can implement syntax highlighting from skimming through the documentation but having someone with in-depth knowledge of the language review it is very valuable. |
Sounds perfect! :) |
The full example contains both comments and strings.
Rego is a rather complex language with a syntax that is not easy to highlight. I implemented the minimum amount of highlighting that can be done with making any assumptions/approximations. It should be correct but it might not be very useful to actual Rego users.
@JordanSh I made my changes. I only implemented minimal language support. All language features are supported but not all get special highlighting. Please review and tell me whether the highlighting makes sense. I removed the highlighting for |
@RunDevelopment, i played with the changes and it looks great!
All and all I believe that this is the right decision. |
Alright, since you accept, I think this is ready. |
Thank you @JordanSh for taking care of this :) <3 |
solving #2571