Debugging Lua scripts in VS Code using MoonSharp
Using MoonSharp as Lua interpreter in a .NET application is quite easy, but the docs lack of a good explanation on how to debug the Lua scripts.  MoonSharp provides a Visual Studio Code extension and a .NET package for a debug server.  I’m going to show how to implement the server using a simple .NET Core Console application.  I won’t explain much about Lua or MoonSharp itself, so I expect you have at least some knowledge on how to use MoonSharp.   You can find my demo application on GitHub .  Preparing the environment  For using MoonSharp, we need to install these NuGet packages:   MoonSharp  MoonSharp.Debugger.VsCode  In VS Code you have to install the MoonSharp Debug extension. Make sure to use the latest VS Code version – in an older version the current line in the debugger wasn’t highlighted.  In the launch.json, you have to put the debugServer  object inside the configuration. The official documentation is wrong here.  Loading the script  For this demo, I added just one simple gl...