doExecute not firing with DefaultProgramRunner

Hello,

I'm trying to develop a plugin for Intellij which will use Debugger.

I'm using this repo as an example, but in my case doExecute never being executed.

https://github.com/mulesoft-labs/data-weave-intellij-plugin/blob/master/data-weave-plugin/src/main/java/org/mule/tooling/lang/dw/debug/WeaveDebuggerRunner.java

 

so in my File only execute method being executed. Any idea why is it like that?


public class StudioScriptDebuggerRunner extends DefaultProgramRunner {
@NotNull
@Override
public String getRunnerId() {
return "StudioScriptDebuggerRunner";
}

@Override
public boolean canRun(@NotNull String executorId, @NotNull RunProfile profile) {
return executorId.equals(DefaultDebugExecutor.EXECUTOR_ID) && profile instanceof StudioDebuggerRunConfiguration;
}

@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();
return super.doExecute(state, env);
}

@Override
public void execute(@NotNull ExecutionEnvironment environment) throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();


Project[] projects = ProjectManager.getInstance().getOpenProjects();
StudioConfigurationProvider config = StudioConfigurationProvider.getInstance(projects[0]);

RunContentDescriptor descriptor = XDebuggerManager.getInstance(environment.getProject()).startSession(environment, new XDebugProcessStarter() {
@NotNull
public XDebugProcess start(@NotNull XDebugSession session) throws ExecutionException {
final SDAPIClient client = new SDAPIClient(config.getHostname(), config.getUsername(), config.getPassword(), "StudioDebuggerClient");
client.createSession();
return new StudioDebuggerProcess(session, client);
}
}).getRunContentDescriptor();

environment.setContentToReuse(descriptor);
}

}

Please sign in to leave a comment.