-
Notifications
You must be signed in to change notification settings - Fork 192
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
Groovy plugin (4.27), Eclipse (2023-3): no support for record
, and possibly other Groovy 4.x features
#1463
Comments
I, in fact, worked very hard on You need to enable the newer parser for this:
|
That sounds great, indeed. I will check this, and report back. |
Hi, I tested it, and it works. Great job; However, I do not understand what it means that for the Parrot Parser, the recovery is not implemented... |
One of my goals for 5.0.0 is to enable the Parrot Parser by default, as everyone would expect. Parser recovery is necessary to provide some sort of Abstract Syntax Tree in the presence of syntax errors. For example if you have "def m() { foo. }" the method's body is incomplete, but if an AST can still be produced for the method and possible the start of a property expression, you can get code completion of "foo." Without this, you get no completion, no type inference and no syntax highlighting.
|
Hey,
Just noticed that @singleton is not parsed (i.e., the instance property on
a Groovy Singleton) in a Java project. Code runs, but Content Assist chokes
(red squiggles)
…On Mon, Apr 3, 2023 at 3:27 PM Eric Milles ***@***.***> wrote:
One of my goals for 5.0.0 is to enable the Parrot Parser by default, as
everyone would expect. Parser recovery is necessary to provide some sort of
Abstract Syntax Tree in the presence of syntax errors. For example if you
have "def m() { foo. }" the method's body is incomplete, but if an AST can
still be produced for the method and possible the start of a property
expression, you can get code completion of "foo." Without this, you get no
completion, no type inference and no syntax highlighting.
—
Reply to this email directly, view it on GitHub
<#1463 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACIWLMKMTBWY56MF32QRETLW7LF23ANCNFSM6AAAAAAWE6HQ2I>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
So I guess not much one can do (?)
…On Tue, May 23, 2023 at 3:00 PM Eric Milles ***@***.***> wrote:
The java model is populated based on the conversion compile phase result.
This excludes most, if not all AST transforms, including ***@***.***`.
See #175, #421, #548, #704, #1474
—
Reply to this email directly, view it on GitHub
<#1463 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACIWLMNXTMUV2JDOT2DS5STXHSYG3ANCNFSM6AAAAAAWE6HQ2I>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The Singleton transform adds a property including an accessor method. You should be able to make the Java model aware of this method. I think it would look something like this:
```groovy
@singleton
class Pogo {
static Pogo getInstance() {
return instance
}
}
```
If you get into "lazy" or "strict" modes this may not work. There may be a way to do this through a trait, but I leave that to you.
|
Good point; this works. Yes, I will investigate lazy and strict (?)
allocation of the Singleton. Thank you for your support!
…On Tue, May 23, 2023 at 9:27 PM Eric Milles ***@***.***> wrote:
The Singleton transform adds a property including an accessor method. You
should be able to make the Java model aware of this method. I think it
would look something like this:
```groovy
@singleton
class Pogo {
static Pogo getInstance() {
return instance
}
}
```
If you get into "lazy" or "strict" modes this may not work. There may be a
way to do this through a trait, but I leave that to you.
—
Reply to this email directly, view it on GitHub
<#1463 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACIWLMOVV3PTU5J3GYD6GYLXHUFSHANCNFSM6AAAAAAWE6HQ2I>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Still no support for
records
, et. al in Eclipse 2023-3:record Vec2(float x, float y) {}
Errors: Groovy:invalid use of declaration inside method call.
The text was updated successfully, but these errors were encountered: