atom/language-java

A space between @ and annotation breaks syntax

Closed this issue · 1 comments

Description

Putting a space between "@" and annotation class name breaks the Java field declaration.

image

package cn . snif5 . medical . orders . transfer ;  
import com . fasterxml . jackson . annotation . JsonProperty ;  
public class DetrainOnlayuiSimpleInfoVo extends DetrainSimpleInfoVo {  
public DetrainOnlayuiSimpleInfoVo ( ) {  
}  
public DetrainOnlayuiSimpleInfoVo ( DetrainSimpleInfoVo simpleInfoVo ) {  
super . setId ( simpleInfoVo . getId ( ) ) ;  
super . setOrderName ( simpleInfoVo . getOrderName ( ) ) ;  
super . setBoxTotalNum ( simpleInfoVo . getBoxTotalNum ( ) ) ;  
super . setBatchNo ( simpleInfoVo . getBatchNo ( ) ) ;  
}  
@ JsonProperty ("layChecked")  
private boolean layChecked ;  
public boolean isLayChecked ( ) {  
return layChecked ;  
}  
public void setLayChecked ( boolean layChecked ) {  
this .

Expected:

image

The fix is simple: just put pattern (\s)* after @ on this line:

'begin': '((@)[^\\s(]+)(\\()'

Yes, I will have a look. Thanks.