Skip to content
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 support for groovy #132

Open
AlexanderZobkov opened this issue Aug 21, 2016 · 4 comments
Open

Add support for groovy #132

AlexanderZobkov opened this issue Aug 21, 2016 · 4 comments
Assignees

Comments

@AlexanderZobkov
Copy link

It would be great if the plugin can format sources that contain groovy code as well.
Probably DefaultGroovyFormatter from https://github.com/groovy/groovy-eclipse can be used for that purpose:
groovy-eclipse/ide/org.codehaus.groovy.eclipse.refactoring/src/org/codehaus/groovy/eclipse/refactoring/formatter/DefaultGroovyFormatter.java

@hazendaz
Copy link
Member

Any chance you might be able to build the groovy support and submit a PR?

Get Outlook for Androidhttps://aka.ms/ghei36

On Sun, Aug 21, 2016 at 3:02 AM -0400, "Alexander" <notifications@github.commailto:notifications@github.com> wrote:

It would be great if the plugin can format sources that contain groovy code as well.
Probably DefaultGroovyFormatter from https://github.com/groovy/groovy-eclipse can be used for that purpose:
groovy-eclipse/ide/org.codehaus.groovy.eclipse.refactoring/src/org/codehaus/groovy/eclipse/refactoring/formatter/DefaultGroovyFormatter.java

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/132, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AA7ho-7NhRXm-l_STy1vfS6TU4VQdzYOks5qh_f0gaJpZM4JpPa3.

@hazendaz hazendaz self-assigned this Mar 29, 2020
@hazendaz
Copy link
Member

I'm looking into this. First try was to use the java formatter as we have it for java. That really has issues with groovy, mostly due to missing semi colon but also seems to squash weirdly. So it is clear portions of the jdt patch that groovy has is needed. Now I need to look into possibility they released that to central. If not, we may need a module like jdst-core to pull that information and then use that to process groovy. It appears it is just a super set and there is a small subset of additional settings users can choose over the inherited java version.

@hazendaz
Copy link
Member

hazendaz commented Apr 5, 2020

This is likely to be complicated. After much digging, I need patches that groovy-eclipse has but doesn't appear to publish outside of the build. In order for this to work, it needs those groovy patches. I'm not clear really on how eclipse even works with this. More specifically the CompilationUnit class has 2 additional parameters for eclipse only. However it also contains a copy of groovy untouched along with full copy of various patches they are doing. I suspect some strange reflection usage and this is only needed at build time. However, when trying to run a solution similar to what we did with jsdt-core, it fails due to this class being necessary.

So, at the moment, I'm going to try to build out their project and if that works, take the JAR I need and some how integrate that into the solution. Even if this works, it effectively means the entire jdt we use now is a waste. This is a complete copy of it to allow groovy to work. My gut tells me all other languages that run on the jvm are doing something similar and the weight is not really worth it here.

I'll keep looking into this but not expecting that this will end up working. Even if it does, I think maybe it warrants a separate plugin as it is not light weight by any means and seriously high on duplication. This is probalby why upon every eclipse upgrade, groovy has to be uninstalled before the upgrade can work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants