atom / language-java

Java package for Atom
Other
62 stars 58 forks source link

Inconsistency of type highlighting in new expression #216

Open Vigilans opened 4 years ago

Vigilans commented 4 years ago

Description

Consider following code:


new File();

new File<>();

new File[];

The second and the last will all be highlighted as type, only the first one will be recognized as function-call:

181 provides another example:

new java.io.File();

It contains a bug (java.io cannot be recognized as any pattern), and File is also a function call:

I have no idea whether this is originally by-design, but I think we should highlight all possible form of types in new expression as type, for these reasons:

Expected behavior:

Types in new expression should be highlighted as type under all circumstances.

Actual behavior:

Some types is highlighted as function-call.

Reproduces how often:

Always