JeanJPNM / mlogls

A language server for the Mindustry Logic programming language
https://marketplace.visualstudio.com/items?itemName=JeanJPNM.mlogls-vscode
GNU General Public License v3.0
4 stars 0 forks source link

feat: debugger #2

Open JeanJPNM opened 1 week ago

JeanJPNM commented 1 week ago

Just like there is the language server protocol to have cross editor support for language features, there also is the debug adapter protocol, which allows any editor to communicate with any protocol-compliant debugger.

The main idea is to create a java mindustry mod with functionality similar to already existent logic debuggers such as deltanedas/ldb that communicates with another process through a websocket connection.

graph TD
  pkg["Package"]
  mod["Mindustry Mod"]
  editor["Editor"]
  editor -->|debug adapter protocol| pkg -->|json messages| mod

I may cut the middleman if putting the DAP functionality directly on the mod takes less effort and doesn't force me to reimplement features already present on the language server.

I still need to investigate what would be the limitations of this approach, a few that come to mind are:

JeanJPNM commented 5 days ago

The debugger could also support sourcemaps to allow users to debug code generated by tools such as mlogjs and mindcode