Can I skip debugging of a script? #452
-
Hi, our users can use Visual Studio Code to write and debug their scripts. Before executing user scripts, the engine loads a few placeholders, containing information about the runtime or occurred events that caused the script execution. The code looks like this: using (V8Runtime runtime = new V8Runtime("V8RuntimeTest"))
{
//If user enables debugging, these flags are set.
var flags = V8ScriptEngineFlags.EnableRemoteDebugging
| V8ScriptEngineFlags.EnableDebugging
| V8ScriptEngineFlags.AwaitDebuggerAndPauseOnStart;
using (V8ScriptEngine engine = new V8ScriptEngine("V8ScriptEngineTest", flags))
{
//I want the debugger to skip this script.
engine.Execute("const placeholders = {"placeholder1":"placeholderValue1","placeholder2":"placeholderValue2"};");
engine.Execute("someUserScript.js", "test(); async function test() { }");
}
} Currently, the Visual Studio Code Debugger halts on the placeholder definition. To improve the user experience I would like the debugger to skip the first script and only enable debugging of the user script. I have tried several approches to achieve this such as using the
Is it possible to tell the Visual Studio Code Debugger to skip the script or can I tell the V8ScriptEngine somehow to enable remote debugging only for the second script? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @MF91WorkPS,
V8 provides no way to enable debugging support on a per-script basis. If you specify However, being able to run "system" scripts before waiting for a debugger connection is something several users have asked for. We'll look into that for a future release. Thanks! |
Beta Was this translation helpful? Give feedback.
Hi @MF91WorkPS,
V8 provides no way to enable debugging support on a per-script basis.
If you specify
V8ScriptEngineFlags.AwaitDebuggerAndPauseOnStart
, ClearScript will wait for a debugger connection the first time you execute a script. There's currently no way to alter that behavior.However, being able to run "system" scripts before waiting for a debugger connection is something several users have asked for. We'll look into that for a future release.
Thanks!