Runtime access to module from "Use classpath and JDK from Module"

My plugin needs to know the module specified in the "Use classpath and JDK from Module" setting in the Run/Debug Configurations dialog.  Basically, my plugin is a debugger and it must know the root module from which the classpath is derived in order to resolve some special class-to-source mappings.  If this specific info is not available during execution, are there other reasonable ways to determine the root module?  Thanks.

Scott

4 comments
Comment actions Permalink

To be specific what was hoping for is a method on DebugProcess, something like getLaunchModule() or some such.  But I don't see anything like this near DebugProcess.  Help?

0
Comment actions Permalink

Hi Scott,
Looks like DebugProcess.getSearchScope() is what you need. This will return the search scope based on the module set in the run configuration.

0
Comment actions Permalink

Thanks, Eugene. I think that'll work just fine; the search scope internally is a ModuleRuntimeClasspathScope, which appears to be the run-configured module.  Very much appreciated!

Scott

0
Comment actions Permalink

One parting comment/request...

What I really want is the runtime *module*, not the search scope.  Essentially, I need the source and content roots of the modules in the runtime module's graph, no more no less. To that end I have to build a dependency graph starting with the runtime module, only there's no reasonable way to get the runtime module.  Right now I'm getting it in a very hacky way via the display name of the runtime search scope (barf).

Scott

0

Please sign in to leave a comment.