eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
36 stars 86 forks source link

[23] Highlight 'module' in module imports #1589

Closed stephan-herrmann closed 2 weeks ago

stephan-herrmann commented 1 month ago

The syntax from https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2383 needs to get some help for highlighting the conditional keyword / restricted identifier module in code like this:

package foo;
import module java.xml;
public class Foo {
    Document doc;
}
stephan-herrmann commented 3 weeks ago

Sneak preview of local implementation based on https://github.com/eclipse-jdt/eclipse.jdt.core/pull/2836: image

I changed the color for restricted identifiers for clarity (see how record is rendered).

This is the code we are referring to:

See that the import declaration can distinguish between occurrences of the word "module" (modifier vs. identifier), which the editor of module-info.java cannot yet.