-
-
Notifications
You must be signed in to change notification settings - Fork 103
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Groovy #44
Comments
OverviewI think the main effort would be to build a Groovy Parser In JavaScript. The secondary effort will be to build a "printer" for the Syntax Tree produced by the parser. @thorbenvh8 please correct me if I am wrong. Grammar ReuseI am no expert on groovy, but I doubt you can re-use the Java Parser to parse groovy. My guess is that the "reuse" would come in the form of copy/pasting code snippets such as AlternativesThe problem with creating your own Parser is that there are often many edge cases Some prettier plugins have taken a different approach which is to find an existing Parser for the plugin's language (often implemented in the plugin's language) and serialize its output to be later de-serialized & printed using JavaScript logic. The advantage is that you get a mature parser, but the disadvantage is the requirement for additional runtimes installed on a user's machine (e.g Python). |
Ok thanks for for the explanation 馃槃 |
@acrewdson I only have a little time to advise on this project currently so I am not looking to start a new large project... :( |
@bd82 no problem, I understand 馃憤 I'm going to keep it on my radar since a groovy autoformatter has been on my wish-list for some time now, and it seems like using (and if others come across this issue and are interested, please speak up) |
Checking if this effort is still alive. Was searching for this today |
For anyone following this thread there seem to be a couple of formatters for Groovy: |
My understanding is that groovy and java are quite similar, curious if this project could also be used to format groovy?
If not, perhaps you could comment on what work would be needed for a prettier-groovy formatter?
Thanks 馃檪
The text was updated successfully, but these errors were encountered: