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

相关推荐
golang学习记21 小时前
VS Code 2026年的正确的打开方式
vscode
小努蛋2 天前
linux编译openresty异常问题,lua_cjson.c:706:5: 错误: ‘for‘ 循环初始化声明只在 C99 或 C++ 模式下允许
开发语言·lua·openresty
BIBI20492 天前
Windows 下 Maven 安装与 VSCode 配置
java·windows·vscode·maven·环境搭建·安装教程
weixin_404679312 天前
godot + vscode ai开发
ide·vscode·编辑器·游戏引擎·godot
我一定会有钱2 天前
vscode system下载安装
ide·vscode·编辑器
2401_858286112 天前
VSCODE远程链接错误: 无法建立链接,过程试图写入的管道不存在的解决方法
ide·vscode·编辑器
像风一样自由20202 天前
加强版VScode结合remote-ssh远程连接服务器开发指南
服务器·vscode·ssh
一朵好运莲3 天前
Turbo Console Log插件VSCode更改log快捷键教程
ide·vscode·编辑器
rockey6273 天前
基于AScript的Lua脚本语言发布啦
c#·.net·lua·script·动态脚本
持敬chijing5 天前
PHP开发-环境搭建-安装phpstudy-vscode工具
开发语言·vscode·php