如何设置luaide调试配置
- 点击vscode左下角的齿轮按钮,再点击设置会弹出配置文件
设置按钮
- 设置分为
2.1 用户设置
2.2 工作区设置
2.3 文件夹设置 -
在搜索栏中输入luaide. 会列出luaide中的所有配置 具体配置
搜索配置
下面列出较复杂的配置 其他配置请直接查看设置中的注释
luaTemplatesDir
LuaIde内置的自定义模板功能

设置路径后LuaIde 将创建
FileTemplates
和 FunTemplate
FileTemplates *文件模板* 可自定义文件模板,可创建多个文件
下图演示模板文件的创建和使用

FunTemplate 方法模板(内置模板可修改内容不可修改文件名)
下图演示模板方法修改 和使用 注意修改方法模板后需要重启vscode

macroList 宏设置
可自定义宏 用于 luaTemplatesDir 配合使用
LuaIde 内置宏请勿覆盖
1. {time}
创建时间
2. {moduleName}
模块名
3. {functionName}
方法名
4. {param}
方法参数替换
5. {paramdesc}
方法参数注释替换
下图演示宏定义添加和使用

scriptRoots 设置
用去LuaIde 的路径检查 require @-return [xxx.xxx] 等功能的基础 为了能够获得更好的提示请务必填写改参数并填写正确

apiType: cocos untiy 提示库库类型 默认 为 none 需要自己根据项目进行设置,多个项目使用不同的api 请在工作区设置中设置
requireFunNames: lua中require方法,将方法名填入此配置后,luaide将把配置的方法名当做require进行提示解析,注意只支持单 function requireEx() end 不支持 function xxx.require() end


网友评论