return;
}
final String sourcePath = computeSourcePath(editor, editorFile, filePath);
final REPLView repl = REPLView.activeREPL.get();
if (repl != null && !repl.isDisposed()) {
try {
evaluateFileText(repl, editor.getDocument().get(), filePath, sourcePath, fileName);
// FIXME: normal that we switch in namespace if start (if no repl), and not if not start ... ?
} catch (Exception e) {
CCWPlugin.logError("Could not start a REPL for loading file " + filePath, e);
}
} else if (editorFile != null) {
CCWPlugin.getTracer().trace(TraceOptions.LAUNCHER, "No active REPL found (",
(repl == null) ? "active repl is null" : "active repl is disposed",
"), so launching a new one");
final IProject project = editorFile.getProject();
new ClojureLaunchShortcut().launchProject(project, mode,
forceLeinLaunchWhenPossible,
new IWithREPLView() {
@Override
public void run(final REPLView repl) {
if (repl != null && !repl.isDisposed()) {
try {
evaluateFileText(repl, editor.getDocument().get(), filePath, sourcePath, fileName);
} catch(Exception e) {
CCWPlugin.logError("Could not start a REPL for loading file " + filePath, e);
}