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

Fix type inferencing, syntax highlighting and code navigation for fields, methods and properties of Map-based types #1148

Closed
eric-milles opened this issue Jul 29, 2020 · 1 comment
Assignees
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Jul 29, 2020

For types that implement java.util.Map, Groovy offers specialized support for property access. Instance fields can only be referenced using the attribute operator (.@). Instance methods can be referenced through a call expression or method pointer/reference operator (.& or ::). Property access through the dot operators (. and .? and probably .*) creates references to map entries instead of fields, properties or methods. And the call operator (()) can also be used to retrieve a value and "call" the result.

Current IDE support for these many variations, including references inside closures that do not have explicit object expressions is a mixed bag (see below).

image
image

@eric-milles eric-milles added this to the v3.9.0 milestone Jul 29, 2020
@eric-milles eric-milles self-assigned this Jul 29, 2020
eric-milles added a commit that referenced this issue Jul 29, 2020
- disable code hover/select for map key
- highlight property expression as MAP_KEY
- propose only fields for "map.@x"
- propose only methods for "map.&x" or "map::x"
- propose only methods for "map.x" (no Java-bean variants)
- change inferred type of getAt(Object,String) extension method

#1143
@eric-milles
Copy link
Member Author

image

image

eric-milles added a commit that referenced this issue Jul 30, 2020
- disable code hover/select for map key
- highlight property expression as MAP_KEY
- propose only fields for "map.@x"
- propose only methods for "map.&x" or "map::x"
- propose only methods for "map.x" (no Java-bean variants)
- change inferred type of getAt(Object,String) extension method

#1143
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

1 participant