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

Grails method-decorating transforms impact type inferencing and syntax highlighting #712

Closed
kszymko opened this issue Sep 10, 2018 · 3 comments
Assignees
Milestone

Comments

@kszymko
Copy link

kszymko commented Sep 10, 2018

Using:

import grails.gorm.transactions.NotTransactional
import grails.gorm.transactions.Transactional

I have groovy services (*Service) classes annotated on class level with @transactional.
Whenever it is commented syntax highlighting works OK (ctrl click on method also works).

If I enable @transactional on class level syntax stops working.
If I mark any method with @NotTransactional then tokens in this method are colored just fine.
Is it because Transactional has:

@GormASTTransformationClass( "org.grails.datastore.gorm.transactions.transform.TransactionalTransform")

If so, why after creating my own TransactionalMy annotation (copy of Transactional) and annotating my services with it - it lets syntax highlighting work fine?

See screenshots and the difference on simple class:

txoff
txon

@eric-milles
Copy link
Member

As expected, the methods have been relocated. The body of m1 and m2 have been transferred to $tt_m1 and $tt_m2 respectively. The type inference visitor does not visit these new methods because they are not part of the parse result.

grails

@eric-milles eric-milles self-assigned this Sep 10, 2018
@eric-milles eric-milles added this to the v3.1.0 milestone Sep 10, 2018
@eric-milles eric-milles changed the title Eclipse 4.8 Grails 3.3.6 @Transactional ON/OFF syntax highlighting in groovy sources Grails method-decorating transforms impact type inferencing and syntax highlighting Sep 10, 2018
@eric-milles
Copy link
Member

Ready to test

@kszymko
Copy link
Author

kszymko commented Sep 10, 2018

Tested. Finally it works as expected.
Thank you so much Eric!

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

No branches or pull requests

2 participants