Over the past month, I've been working on a Debug Adapter Protocol client for Textadept, a minimalist text editor with Lua scripting. Now, I'm finally ready to release version 0.1 of textadept-dap publicly. This is my first major project that I've actually gotten to a public release, and I'd like to talk a bit about the development process and my plans for the future.
Why I Created textadept-dap
While Textadept already has a debugger module, it's not very good. It requires a manual implementation of debugger commands for every single debugger which you want to use, and It currently only supports 3 (GDB, Go, and a Lua). However, I wanted to use LLDB, and didn't trust the GDB mode to use compatible commands. Moreover, I also worried about debugging other languages in the future. Clearly a generic solution was needed.
Luckily for me, a generic protocol for implementing debugger clients already exists: the Debug Adapter Protocol, a.k.a. DAP. It is very similar to the Language Server Protocol, which textadept already has a client for. As such I set out to create an implementation of the DAP for Textadept.
I decided against creating a new debugger implementation for textadept-debugger, as I felt a dap client would naturally make the other implementations redundant, and wanted to design a UX which would be easily translatable to DAP messages. I also wanted a more rigorous test suite and a more modular architecture, as opposed to a monolithic UX module with debugger-specific implementation modules.
Testing Out Test-Driven Development
This project was also an opportunity for me to try out many extreme programming practices I had been studying as of late, especially test-driven development. Writing tests before implementation felt odd at first, but I've now found it to be the superior way of writing code. I also aimed for a short iteration cycle and minimal first release as suggested in Extreme Programming Explained. Honestly, I'm quite proud of some bits of the codebase I've built, though there is still much room for improvement.
While the first release is incredibly minimal and lacking many important features like logging, messages, call stack and variable views, focus stealing, and more, it at least has the core features of a debug client like breakpoints and stepping, which I can build off of.
Forward-Looking
I'll be taking a break to work on other projects, most likely Europa now that Unreal 5.8 has released. I'm thinking of doing a massive code throw-out for that project, but that's a story for another blog.
textadept-dap is released into the public domain, and contributions are welcome under the following conditions:
- No AI generated code (NO EXCEPTIONS).
- Commits must follow the conventional commits formatting defined in `git-conventional-commits.yaml`.
- Introduction of new features or functionality must be accompanied by appropriate unit tests.