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调试吧

相关推荐
HarrySunCn3 小时前
如何使用VSCode开发Arduino项目
ide·vscode·单片机·编辑器
面壁的熊猫7 小时前
cursor+cline+MCP(论文agent)
vscode·agent·cursor·mcp
Aspect of twilight10 小时前
vscode python debug方式
ide·vscode·python·debug
啃火龙果的兔子12 小时前
vscode中可以使用的免费的AI编程工具有哪些
ide·vscode·ai编程
littlezls13 小时前
在VSCode中运行Python脚本文件时如何传参
vscode·python
宋明炜13 小时前
VSCode + MSYS2 配置 C 语言开发环境(详细步骤)
c语言·ide·vscode
yscript13 小时前
GPU分配BUG: Duplicate GPU detected : rank 1 and rank 0 both on CUDA device d5000
linux·运维·服务器·vscode·bug
IMPYLH14 小时前
Lua 的 xpcall 函数
开发语言·笔记·后端·游戏引擎·lua
shhpeng14 小时前
Visual Studio Code 下 go 开发环境搭建
ide·vscode·编辑器
newobut1 天前
vscode远程调试python程序,基于debugpy库
vscode·python·调试·debugpy