// TODO: Add environments support
IExecutionEnvironment exeEnv = (IExecutionEnvironment) EnvironmentManager
.getLocalEnvironment().getAdapter(IExecutionEnvironment.class);
IFileHandle scriptFile = _javascript_LaunchingPlugin.getDefault()
.getConsoleProxy(exeEnv);
ScriptLaunchUtil.runScript(_javascript_Nature.NATURE_ID, scriptFile,
null, null, args, null);
but that is really not working for our case..
Because that just tries to run a script.. That cant happen for us because our scripts are already running in a rhino debug environment (remotely)
So my question is why is it this way? Why isnt it just connection to the active suspended IScriptThread/ScriptFrame ?
i just do it in one simple method:
private String execute(String txt)
{
IScriptThread scriptThread = getActiveScriptThread();
if (scriptThread != null)
{
IScriptStackFrame frame = null;
try
{
IStackFrame[] stackFrames = scriptThread.getStackFrames();
if (stackFrames.length == 0) return null;
frame = (IScriptStackFrame) stackFrames[stackFrames.length-1];
}
catch (DebugException ex1)
{
ex1.printStackTrace();
}
IScriptEvaluationResult syncEvaluate = scriptThread.getEvaluationEngine().syncEvaluate(txt, frame);
if (syncEvaluate.getValue() != null)
{
try
{
return syncEvaluate.getValue().getValueString();
}
catch (DebugException ex)
{
return ex.toString();
}
}
return syncEvaluate.getException().toString();
}
return null;
}
and that works great.. Through the dbgp protocol and debug connection..
But i get a very itchy feeling now that for many parts i am now duplicating code :( (History/Code completion)
So why does the current ScriptConsole implementation not go through the dbgp protocol?
I just enable my view based on a SUSPEND and disable it again on a RESUME event from the DebugPlugin..
One little problem if there where 2 launches that both are suspended. I have no idea what is the selected one is (but that should be a listener somewhere i guess)
Are there any plans to rewrite the console so that i works through the protocol and with an existing debugging session?
johan
_______________________________________________ dltk-dev mailing list
dltk-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/dltk-dev