# How to wire up a ScriptRun.ScriptSource to a DebugCodeEdit?

**URL:** https://forum.alternetsoft.com/t/how-to-wire-up-a-scriptrun-scriptsource-to-a-debugcodeedit/521
**Category:** AlterNET Studio Support
**Tags:** scripter, editor, wpf
**Created:** [January 23, 2026, 11:03am UTC](https://forum.alternetsoft.com/t/how-to-wire-up-a-scriptrun-scriptsource-to-a-debugcodeedit/521 "2026-01-23T11:03:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tsp\_extern\_pa](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/t/606060/32.png) [@tsp\_extern\_pa](https://forum.alternetsoft.com/u/tsp_extern_pa)
#### Post date: [January 23, 2026, 11:03am UTC](https://forum.alternetsoft.com/t/how-to-wire-up-a-scriptrun-scriptsource-to-a-debugcodeedit/521/1 "2026-01-23T11:03:57Z")

</div>

How can i wire up the ScriptSource from a ScriptRun to a DebugCodeEdit or ScriptCodeEdit, so that i can live change the code and let it compile/run, when i need it to - but let the lexer do its thing automatically, so that i get instant error feedback?

My use case is

- Single editor instance
- Clearing the source
- Overwrite the source with a script (without a file)
- Load a source from a file
- Save the source to a file
- Compile/Execute that source
- No code behind, everything is abstracted into a service that is injected into the view model

What is correct way to do this (in the simplest way possible)?

---

<div class="post-metadata">

### Author: ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)
#### Post date: [January 27, 2026, 8:17am UTC](https://forum.alternetsoft.com/t/how-to-wire-up-a-scriptrun-scriptsource-to-a-debugcodeedit/521/2 "2026-01-27T08:17:16Z")

</div>

Hello,

We looked at this scenario, and while it’s possible, it requires a small change in our debugger, which will be included in the coming update.

I will keep you posted and will attach a sample project when it’s done.

Kind regards,

Dmitry

---

<div class="post-metadata">

### Author: ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)
#### Post date: [February 6, 2026, 6:22am UTC](https://forum.alternetsoft.com/t/how-to-wire-up-a-scriptrun-scriptsource-to-a-debugcodeedit/521/3 "2026-02-06T06:22:58Z")

</div>

Hello,

I’ve uploaded a sample project showing how to instantiate script debugging from the source code here:

> **[DebuggerIntegrationFromSource.zip](https://drive.google.com/file/d/1JtN411Ye5fVzliEosl9o74BkawAKK11W/view?usp=sharing)**
>
> Google Drive file.

Please let me know if this is what you’re looking for.

Kind regards,Dmitry
