Closed stephan-herrmann closed 2 months ago
If module imports were a strongly debated feature I'd say let's wait until it leaves preview state, but specifically with its connection to implicitly declared classes I guess it's safe to assume that this feature will stay.
I have a quick-n-dirty draft of such addition, but I'd like to discuss this approach first, because now it looks a bit odd to have
isStatic()
andmodifiers()
. Should the latter answer aModifier
also for static?? Should we migrate the internal storage to list of Modifier and only mapisStatic()
andsetStatic()
to corresponding acrobatics? This looks similar to howModifier
lists were introduced for JLS3 in the first place.
Yes, we can may be have a general modifiers() and perhaps a retirement plan for the isStatic() and family. It will be redundant for a while, but definitely future-proof.
The tiny feature https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1589 has a tiny follow-up https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1589 where all the sudden it seems we need to extend the DOM AST:
In a regular compilation unit
module
is not a keyword and hence it would be suitable to apply semantic highlighting (category restricted identifiers). But then we'd need an ASTNode that informs us about the position of the modifier.It's a real pity that introduction of
import static
was answered just with a boolean flag inImportDeclaration
. At this point we'd be better off with a list ofModifier
.I have a quick-n-dirty draft of such addition, but I'd like to discuss this approach first, because now it looks a bit odd to have
isStatic()
andmodifiers()
. Should the latter answer aModifier
also for static?? Should we migrate the internal storage to list of Modifier and only mapisStatic()
andsetStatic()
to corresponding acrobatics? This looks similar to howModifier
lists were introduced for JLS3 in the first place.@jarthana @mpalat wdyt?