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 trait property references #1113

Closed
eric-milles opened this issue May 12, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented May 12, 2020

https://stackoverflow.com/questions/61713375/trait-methods-are-not-fully-visible-in-groovy-eclipse

Consider the following:

trait T {
  String foo
}
class C implements T {
  def m() {
    foo
  }
}

Reference to "foo" is shown as unknown (underlined).

Unlike #953 and #960, the trait is declared in a separate source unit. This issue falls in a gap between #960 and #704. Some trait fields and methods are not represented in the JDT model (GroovyCompilationUnitDeclaration, GroovyTypeDeclaration and SourceTypeBinding) since they are not compatible with Java 7 interfaces and to prevent warnings for unimplemented abstract methods. Thus they are not available in a JDTClassNode that is created for source reference.

To be available for type inferencing, etc. the JDTClassNode for a trait needs to be populated with the missing fields, methods and properties.

image

@eric-milles
Copy link
Member Author

image

eric-milles added a commit that referenced this issue Aug 23, 2021
eric-milles added a commit that referenced this issue Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant