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