RSTALanguageSupport icon indicating copy to clipboard operation
RSTALanguageSupport copied to clipboard

Support loaded classes adhoc in jvm

Open haesleinhuepf opened this issue 7 years ago • 2 comments

Hey guys,

with this change, currently loaded classes are supported by autocomplete. In case the JarManager does not know a class, it tries to get the ClassFile from the classes which are currently loaded in the JVM. In Fijis script editor, we are working with hundreds of JAR files. Loading all classes in all of them would take a long time. Instead, ad-hoc loading one particular class from a JAR file appears beneficial for performance.

If you want to try this change, publish it to your local maven repository and execute the main method (from your IDE): https://github.com/haesleinhuepf/script-editor/blob/playing_wth_java_autocomplete/src/main/java/org/scijava/ui/swing/script/demo/Demo.java#L16

And enter code like this in the editor window:

import ij.plugin.PlugIn;
import ij.*;

public class Bare_PlugIn implements PlugIn {
	@Override
	public void run(String arg) {
		IJ.
	}
}

Then, open the auto-complete pulldown behind IJ. and you will see static members even though the JarManager doesn't know about IJ.jar.

Please let me know what you think about this!

Cheers, Robert

haesleinhuepf avatar Jun 26 '18 09:06 haesleinhuepf

Any update on this? Can it be merged?

imagejan avatar Dec 04 '18 11:12 imagejan

@bobbylight is there anything blocking this pull request from being merged? I'm sure @haesleinhuepf can rebase the branch onto master if necessary.

imagejan avatar Apr 24 '20 10:04 imagejan