Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-debug-dev] Pluggable Source Locator?


Java launch configurations allow for programatic launching of Java programs, in which the following attributes can be set:

* Main type name
* Java project
* JRE
* Program args
* VM args
* Working Directory
* Classpath
* Bootpath
* Extension path
* Environment variables

Currently, the Java launch configuration delegates, hardwire a "JavaSourceLocator" with each launch. The source locator uses the project's custom source lookup path (specified via project properties), or build path (by default), to locate source. However, the source locator is not "pluggable", and ideally, should be.

For example, there are two Java source locators. One lives in "org.eclipse.jdt.launching", and is headless. The other lives in "org.eclipse.jdt.debug.ui", and prompts the user for source when source can not be found. Currently, the java launch configuration delegates provide a "headless" source locator with each launch. Since this is not what users want, the Java debug UI plug-in replaces headless source locators with "prompting" source locators, as Java programs are launched (via the launch listener mechanism). Although this gives the desired result (most of the time), it would be better if a source locator could simply be specified in a Java launch configuration.

To make the source locator pluggable, I believe we would need to allow clients to specify the TYPE of source locator to use, and a MEMENTO from which to create/initialize a source locator (which is specific to the type of source locator). For example, one may want to specify to use either a headless or prompting source locator (TYPE). Then one may want to specify that the source locator use the default buildpath to locate source, or to look in a custom set of  locations for source (MEMENTO).

To make this mechanism extensible, a Java source locator should be specified as an extension point. And to make the existing Java source locators more configurable, we would also need to make "source locations" be an extension point. Currently we provide two types of source locators (headless and prompting). And we provide three types of source locations - projects, local file system directories, and local file system jars/zips. By making these two extension points, clients could provide other types of source locators and locations.

Interested parties, please provide feedback/comments.

Thanks.

Back to the top