Skip to content

Commit 2ecfbef

Browse files
committed
Autocomplete public methods, too
1 parent 5e05056 commit 2ecfbef

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/org/scijava/script/AbstractAutoCompleter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
package org.scijava.script;
3333

3434
import java.lang.reflect.Field;
35+
import java.lang.reflect.Method;
3536
import java.util.ArrayList;
3637
import java.util.Arrays;
3738
import java.util.Collections;
@@ -141,6 +142,12 @@ private List<String> engineAttributesCompleter(final String objectString,
141142
matches.add(objectString + field.getName());
142143
}
143144
}
145+
// check for public method completions
146+
for (final Method method : obj.getClass().getMethods()) {
147+
if (method.getName().toLowerCase().startsWith(lPrefix)) {
148+
matches.add(objectString + method.getName() + "(");
149+
}
150+
}
144151
}
145152
}
146153

0 commit comments

Comments
 (0)