Search in sources :

Example 1 with ErlangOtpSourceContainer

use of org.erlide.backend.debug.model.ErlangOtpSourceContainer in project erlide_eclipse by erlang.

the class ErlangSourcePathComputerDelegate method computeSourceContainers.

@Override
public ISourceContainer[] computeSourceContainers(final ILaunchConfiguration configuration, final IProgressMonitor monitor) throws CoreException {
    final List<ISourceContainer> containers = new ArrayList<>();
    final IProject[] projects = LaunchUtils.getErlangLaunchConfigurationProjects(configuration);
    for (final IProject p : projects) {
        containers.add(new ProjectSourceContainer(p, false));
    }
    if (containers.isEmpty()) {
        containers.add(new WorkspaceSourceContainer());
    }
    final String runtimeName = configuration.getAttribute(ErlRuntimeAttributes.RUNTIME_NAME, "").trim();
    final RuntimeInfo info = BackendCore.getRuntimeInfoCatalog().getRuntime(runtimeName);
    containers.add(new ErlangOtpSourceContainer(new Path(info.getOtpHome())));
    return containers.toArray(new ISourceContainer[containers.size()]);
}
Also used : Path(org.eclipse.core.runtime.Path) WorkspaceSourceContainer(org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer) RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) ErlangOtpSourceContainer(org.erlide.backend.debug.model.ErlangOtpSourceContainer) ArrayList(java.util.ArrayList) ISourceContainer(org.eclipse.debug.core.sourcelookup.ISourceContainer) ProjectSourceContainer(org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer) IProject(org.eclipse.core.resources.IProject)

Aggregations

ArrayList (java.util.ArrayList)1 IProject (org.eclipse.core.resources.IProject)1 Path (org.eclipse.core.runtime.Path)1 ISourceContainer (org.eclipse.debug.core.sourcelookup.ISourceContainer)1 ProjectSourceContainer (org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer)1 WorkspaceSourceContainer (org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer)1 ErlangOtpSourceContainer (org.erlide.backend.debug.model.ErlangOtpSourceContainer)1 RuntimeInfo (org.erlide.runtime.runtimeinfo.RuntimeInfo)1