vscode中使用luaide-lite插件断点调试cocos2dx-lua

使用quick-cocos2dx-lua,用了众多插件,包括免费的BabeLua,VS调试太慢,vscode上的免费的EmmyLua, 还有收费的luaide,都没搞出来,唯独这个免费luaide-lite用成功了,步骤也简单,可以断点调试,查看变量数值,非常实用,简单记录下

  1. 在vscode插件里下载luaide-ide,如下图:
  1. 配置launch.json
cpp 复制代码
{
            "name": "COCOS(remote debugging)",
            "type": "lua",
            "request": "launch",
            "runtimeType": "Cocos3",
            "localRoot": "${workspaceRoot}",
            "commandLine": ["-workdir ${workspaceRoot}/../ -file src/main.lua"],
            "port": 7003,
            "mainFile": "src/main.lua",
            "exePath": "D:/malai_pub/hall/runtime/win32/hall.exe",
            "printType": 1
        },

这里commandLine,和mainFile,exePath可以根据自己的代码的情况自己配,我的是先装了luaIde让它自己配置了看它的示例写的

3 . 下载luaide-lite的配置文件,丢到自己lua工程代码根目录下,其中一个是LuaDebug.lua,一个是luaide文件夹,配置文件 luaide-lite配置文件 ,您也可以自己到官方github下:GitHub - wellshsu/luaide-lite: Lua developement and debug tools.

  1. 将以下标注代码添加在main.lua处

代码:require("LuaDebug")("localhost", 7003)

其实只需要那句require("LuaDebug")("localhost", 7003)就行了,其他什么bRemoteDebug啊都是无效代码

OK,现在就已经完事了,在vscode里下断点,然后选中你刚才的debug配置,开始按F5调试吧

相关推荐
2501_9159214310 小时前
iOS开发环境搭建详解 Xcode 配置与快蝎轻量级工具选择
ide·vscode·macos·ios·个人开发·xcode·敏捷流程
wardenlzr13 小时前
VSCode 运行 Live Server 提示「Windows 找不到文件 Chrome」问题全解析
chrome·windows·vscode
程序员more14 小时前
我用 AI,20 分钟做了一个 VSCode 股票摸鱼插件
人工智能·vscode
减瓦15 小时前
告别Postman——用VSCode优雅地发起Http请求
vscode·http·postman
csdn2015_18 小时前
vscode从gitlab拉项目到本地
vscode·gitlab
寒水馨2 天前
Windows下载、安装neovim-v0.12.4(附安装包nvim-win64.msi)
windows·编辑器·vim·lua·终端·lsp·neovim
烤代码的吐司君2 天前
Lua 脚本
开发语言·junit·lua
寒水馨2 天前
macOS下载、安装neovim-v0.12.4(附安装包nvim-macos-arm64.tar.gz)
macos·vim·lua·文本编辑器·终端·lsp·neovim
shmily麻瓜小菜鸡2 天前
浏览器在请求外部图片(403 Forbidden)问题
vue.js·vscode·echarts·angular.js
Yolanda_20222 天前
在vscode终端中可使用pip,但是cmd终端中找不到命令 pip问题的解决
vscode·python·conda·pip