@@ -50,7 +50,7 @@ public boolean isValidChar(final char c) {
50
50
}
51
51
52
52
static private final Pattern
53
- fromImport = Pattern .compile ("^(from[ \\ t]+)([a-zA-Z][a-zA-Z0-9._]*)$" ),
53
+ fromImport = Pattern .compile ("^(( from|import) [ \\ t]+)([a-zA-Z][a-zA-Z0-9._]*)$" ),
54
54
fastImport = Pattern .compile ("^(from[ \\ t]+)([a-zA-Z][a-zA-Z0-9._]*)[ \\ t]+$" ),
55
55
importStatement = Pattern .compile ("^((from[ \\ t]+([a-zA-Z0-9._]+)[ \\ t]+|[ \\ t]*)import(Class\\ (|[ \\ t]+))([a-zA-Z0-9_., \\ t]*)$" ),
56
56
simpleClassName = Pattern .compile ("^(.*[ \\ t]+|)([A-Z_][a-zA-Z0-9_]+)$" ),
@@ -72,15 +72,15 @@ public List<Completion> getCompletionsImpl(final JTextComponent comp) {
72
72
// E.g. "from ij" to expand to a package name and class like ij or ij.gui or ij.plugin
73
73
final Matcher m1 = fromImport .matcher (text );
74
74
if (m1 .find ())
75
- return asCompletionList (ClassUtil .findClassNamesContaining (m1 .group (2 ))
75
+ return asCompletionList (ClassUtil .findClassNamesContaining (m1 .group (3 ))
76
76
.map (new Function <String , String >() {
77
77
@ Override
78
78
public final String apply (final String s ) {
79
79
final int idot = s .lastIndexOf ('.' );
80
- return s .substring (0 , Math .max (0 , idot )) + " import " + s .substring (idot +1 );
80
+ return "from " + s .substring (0 , Math .max (0 , idot )) + " import " + s .substring (idot +1 );
81
81
}
82
82
}),
83
- m1 . group ( 1 ) );
83
+ "" );
84
84
85
85
final Matcher m1f = fastImport .matcher (text );
86
86
if (m1f .find ())
0 commit comments