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 semantic highlighting (aka syntax coloring) of Types #727

Closed
eric-milles opened this issue Sep 20, 2018 · 2 comments
Closed

Add semantic highlighting (aka syntax coloring) of Types #727

eric-milles opened this issue Sep 20, 2018 · 2 comments
Assignees
Milestone

Comments

@eric-milles
Copy link
Member

Java editor can separately color Classes, Interfaces, Abstract Classes, Annotation definitions, Enums, Type Parameters and Type Arguments. Add similar support to Groovy Editor.

See

  • org.codehaus.groovy.eclipse.editor.highlighting.GroovySemanticReconciler
  • org.codehaus.groovy.eclipse.editor.highlighting.HighlightedTypedPosition.HighlightKind
  • org.codehaus.groovy.eclipse.editor.highlighting.SemanticHighlightingReferenceRequestor
@eric-milles eric-milles added this to the v3.3.0 milestone Oct 17, 2018
@eric-milles eric-milles removed this from the v3.3.0 milestone Jan 9, 2019
@eric-milles eric-milles added this to the v3.4.0 milestone Mar 18, 2019
@eric-milles eric-milles self-assigned this Jun 12, 2019
eric-milles added a commit that referenced this issue Jun 13, 2019
Current source range for ClassNode with GenericsTypes:

    Map<X, Y> map
    ^^^

    Map.Entry<X,Y> entry
    ^^^^^^^^^^^^^^

#727
eric-milles added a commit that referenced this issue Jun 14, 2019
Separate coloration available for each of the following:
* classes
* abstract classes
* annotations
* enumerations
* interfaces
* traits
* type parameters

#727
@eric-milles
Copy link
Member Author

eric-milles commented Jun 14, 2019

Unimplemented items and differences between Groovy and Java Editor:

  • Some well-known, fully-qualified type references may not highlight in certain situations (see org.codehaus.groovy.ast.ClassHelper for the list of types)
  • Type arguments are not highlighted with their own separate preference (Java editor does this)
  • When method highlighting is turned off, constructor calls do not have their type reference highlighted (Java editor does this)

NOTE: As with the Java editor, packages and imports are not colored.

@eric-milles eric-milles changed the title Add semantic highlighting (aka syntax coloring) of Types, Type Arguments, and Type Parameters Add semantic highlighting (aka syntax coloring) of Types Jun 16, 2019
@eric-milles
Copy link
Member Author

After:
types-after

Before:
types-before

asfgit pushed a commit to apache/groovy that referenced this issue Dec 7, 2019
groovy/groovy-eclipse#727

import static Foo.getSomeThing as something
@groovy.transform.CompileStatic
class Bar {
  def baz(x, y) {
    something(x, y) // includes "Foo" (line 1, column 14)
  }
}
asfgit pushed a commit to apache/groovy that referenced this issue Dec 9, 2019
groovy/groovy-eclipse#727

import static Foo.getSomeThing as something
@groovy.transform.CompileStatic
class Bar {
  def baz(x, y) {
    something(x, y) // includes "Foo" (line 1, column 14)
  }
}

(cherry picked from commit e4dbbae)
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