luaIde debugging openresty
Debugging video
extraction code: o3rk
1. Create a project if the project already exists ignored
2. Create a project src directory
(src目录可是任意名字 示例中将src放入根目录中,您也可以放到其他目录,src目录为lua脚本根目录)
如果已存在项目忽略
3. Configuration Items
The first three steps can be ignored according to their own projects can be set.
Example 4. Open project files project files in the folder to folder vscode openresty_test
5. Open a lua file to start luaide plug (not demo lua file, create a file test.lua)
6. Follow the prompts to copy the debug file to the src directory
选择LuaDebugOpenrestyJit 后缀选择.lua
由于luaide支持多种lua框架的调试所以会有很多不同的后缀名,openresty 选择.lua即可
这一步操作后 LuaDebugOpenrestyJit.lua 拷贝到src 下
7. Click vscode luaide the left button to select [Open luaide latest debug folder where the file]
linux 找到socketLib\OpenResty\linux目录下的 socket.so 拷贝到openresty_test(项目根目录)
mac 找到socketLib\OpenResty\mac目录下的 socket.so 拷贝到openresty_test(项目根目录)
windows 找到socketLib\OpenResty\windows目录下的 socket.so 拷贝到openresty_test\lualib(项目根目录\lualib)
8. Set Script root directory luaide Settings selected configuration (as set Chinese)
搜索luaide.scriptRoots 并进行设置 然后重启vscode
这里注意vscode 的设置配置分为
1.用户设置
2.工作空间设置 示例中添加到了 工作空间设置 设置后重启vscode f1 reloadwindow
3.文件夹设置
修改配置后重启vscode f1 reload window
9. Add debugging code to start debugging
10. Add debug configuration
11. Start Debugging -p nginx pwd
/ -c conf / nginx.conf (start the debugger to start their own projects according to their own situation. Here are just demo)
12. Access page
Debug Demo end!
Reproduced in: https: //www.jianshu.com/p/070870d43368