atom/language-java

A space between class name and "[]" breaks the array declaration.

Closed this issue · 2 comments

Description

Putting a space between class name and "[]" breaks the array declaration.

image

package com.sell.controller; 
import java.util.*;

public class testbug{

    public static void main(String [] args){
        String str = "";
        String [] arr = str.split("s");
//            ^ space
        for (int i = 0 ; i < arr.

Expected:

image

I fixed it by replacing

(\\[\\])* # int[][]

to

(\\s*\\[\\])* # int[][]

Thanks, I will try patching it tonight.

Fixed in #197.