atom / language-java

Java package for Atom
Other
62 stars 58 forks source link

Fix annotation scope and handle spaces between @ and annotation name #195

Closed sadikovi closed 5 years ago

sadikovi commented 5 years ago

Requirements

Description of the Change

This PR fixes the issue of scope and highlighting being invalid when space is inserted between @ and annotation name, e.g. @ Annotation as opposed to @Annotation. We basically need to insert \\s* in the correct place. However, I observed that patterns are invalid in a sense that they capture @ as part of annotation name scope.

So I also fixed the scope of annotations so that storage.type.annotation.java does not capture @. They both have parent scope meta.declaration.annotation.java. This makes them similar to @interface.

Alternate Designs

None were considered.

Benefits

Fixes issue when using spaces in annotations.

Possible Drawbacks

None

Applicable Issues

Closes #194