Local Lua Debugger for Visual Studio Code 使用教程

Local Lua Debugger for Visual Studio Code 使用教程

local-lua-debugger-vscodeLocal Lua Debugger for VSCode项目地址:https://gitcode.com/gh_mirrors/lo/local-lua-debugger-vscode

1. 项目的目录结构及介绍

local-lua-debugger-vscode/
├── .vscode/
│   └── launch.json
├── resources/
│   └── Lua-Logo_128x128.png
├── test/
│   ├── start-cli.lua
│   ├── start-interpreter.lua
│   └── ...
├── .gitignore
├── LICENSE
├── README.md
├── package.json
└── ...

目录结构介绍

  • .vscode/: 包含 Visual Studio Code 的配置文件,如 launch.json
  • resources/: 包含项目使用的资源文件,如图标。
  • test/: 包含项目的测试文件。
  • .gitignore: Git 忽略文件列表。
  • LICENSE: 项目的开源许可证。
  • README.md: 项目的说明文档。
  • package.json: 项目的元数据文件,包含项目的基本信息和依赖。

2. 项目的启动文件介绍

启动文件

  • test/start-cli.lua: 用于启动命令行界面的测试脚本。
  • test/start-interpreter.lua: 用于启动解释器的测试脚本。

启动文件内容示例

-- test/start-cli.lua
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
    require("lldebugger").start()
end
describe("a test", function() end)
-- test/start-interpreter.lua
-- busted should be required before hooking debugger to avoid double-hooking
require("busted.runner")()
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
    require("lldebugger").start()
end
describe("a test", function() end)

3. 项目的配置文件介绍

配置文件

  • .vscode/launch.json: 用于配置 Visual Studio Code 的调试设置。

配置文件内容示例

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "lua-local",
            "request": "launch",
            "program": {
                "command": "dmengine"
            },
            "args": ["/build/default/game.projectc"],
            "scriptRoots": [""] // Required for debugger to find scripts
        }
    ]
}

配置文件说明

  • name: 调试配置的名称。
  • type: 调试类型,这里是 lua-local
  • request: 请求类型,这里是 launch
  • program: 启动命令,这里是 dmengine
  • args: 启动命令的参数。
  • scriptRoots: 脚本根目录,用于调试器查找脚本文件。

以上是 Local Lua Debugger for Visual Studio Code 项目的目录结构、启动文件和配置文件的介绍。希望这份教程能帮助你更好地理解和使用该项目。

local-lua-debugger-vscodeLocal Lua Debugger for VSCode项目地址:https://gitcode.com/gh_mirrors/lo/local-lua-debugger-vscode

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

张姿桃Erwin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值