Skip to content

EmmyLuaLs/emmylua_dap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 EmmyLua Debug Adapter

A powerful Debug Adapter Protocol (DAP) implementation for Lua debugging

Rust Platform Lua LuaJIT

Built on top of the robust EmmyLuaDebugger foundation


✨ Features

  • 🎯 Debug Adapter Protocol (DAP) compatible
  • 🔧 Cross-platform support (Windows, Linux, macOS)
  • 🚀 Easy integration with any DAP-compatible editor
  • 🐛 Advanced debugging capabilities for Lua applications
  • 🌟 LuaJIT support for high-performance Lua applications
  • 📁 Multiple file extensions support (.lua, .lua.txt, .lua.bytes)
  • 🌐 TCP connection for remote debugging

🚀 Quick Start

📦 Installation

  1. Download the latest release from the releases page
  2. Extract the executable to your desired location
  3. Ensure the emmy_core library is available in your Lua environment

🛠️ Setup Your Lua Application

Add the following debug code to your Lua application:

🖥️ Windows

-- Add the emmy_core library to your package path
package.cpath = package.cpath .. ";<path_to_emmy_core>/?.dll"

-- Initialize the debugger
local dbg = require("emmy_core")
dbg.tcpListen("localhost", 9966)

-- Optional: Wait for IDE connection
-- dbg.waitIDE()

-- Optional: Set a breakpoint
-- dbg.breakHere()

🐧 Linux

-- Add the emmy_core library to your package path
package.cpath = package.cpath .. ";<path_to_emmy_core>/?.so"

-- Initialize the debugger
local dbg = require("emmy_core")
dbg.tcpListen("localhost", 9966)

-- Optional: Wait for IDE connection
-- dbg.waitIDE()

-- Optional: Set a breakpoint
-- dbg.breakHere()

🍎 macOS

-- Add the emmy_core library to your package path
package.cpath = package.cpath .. ";<path_to_emmy_core>/?.dylib"
-- Initialize the debugger
local dbg = require("emmy_core")
dbg.tcpListen("localhost", 9966)

-- Optional: Wait for IDE connection
-- dbg.waitIDE()

-- Optional: Set a breakpoint
-- dbg.breakHere()

⚙️ DAP Configuration

Create a launch configuration in your editor:

{
    "type": "emmylua_new",
    "request": "launch",
    "name": "🐛 EmmyLua Debug Session",
    "host": "localhost",
    "port": 9966,
    "sourcePaths": [
        "${workspaceFolder}"
    ],
    "ext": [
        ".lua",
        ".lua.txt",
        ".lua.bytes"
    ],
    "ideConnectDebugger": true
}

🎮 Usage

  1. Add debug code to your Lua application (see setup section above)
  2. Start your Lua program - it will wait for the debugger to connect
  3. Launch the debug session from your editor using the DAP configuration
  4. Set breakpoints and start debugging! 🎉

🔧 Editor Integration

VS Code

Currently, the EmmyLua extension does not use this project as its DAP implementation.

Neovim

  1. Use nvim-dap plugin
  2. Configure the DAP adapter
  3. Set up launch configuration

IntelliJ IDEA

  1. Install the "LSP4IJ" plugin
  2. Configure the DAP adapter in the dap configuration
  3. Set up a run configuration for your Lua application

Other Editors

Any editor that supports the Debug Adapter Protocol can be used:

  • Vim (with DAP plugins)
  • Emacs (with DAP mode)
  • Eclipse (with DAP extensions)

📋 Configuration Options

Option Type Description Default
host string Debug server host "localhost"
port number Debug server port 9966
sourcePaths array Source code directories ["${workspaceFolder}"]
ext array Supported file extensions [".lua", ".lua.txt", ".lua.bytes"]
ideConnectDebugger boolean IDE initiates connection true

🤝 Contributing

We welcome contributions! Please feel free to:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests
  • 📚 Improve documentation

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • EmmyLuaDebugger - The core debugging engine
  • Contributors who help improve this project

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages