Introduction/介绍
Lua Booster is a VSCode plugin for lua. It's core uses c++ for developing, thus guaranteed a low memory consumption while ensuring high performance. It can support lua project with more than 10,000 files. It can help you write lua code safely and effectively.
What's more, you can customize require modules and rules for static check(lint).
Lua Booster 是一款针对lua语言的VSCode插件。底层使用 c++ 开发,在保证高性能的同时满足低内存消耗。可以对拥有 10,000+ 文件的超大型lua工程提供支持。它能够帮助你安全高效的使用Lua编程。
此外,用户还能够自定义模块化(require)和静态检查规则。
Features/特性演示
Quick Coding/快速编码:
Code Inspection/代码检查:
Debug/调试:
Ect./其他:
Quick Navigation/快速导航
Installation/安装
Install from marketplace
- Click VSCode extension market icon
- Search
Lua Booster
- Click and install
Lua Booster
Install from command line
- CTRL/CMD+p
- Copy/Past or type in
ext install operali.lua-booster
- ENTER
应用市场安装
- 点击VSCode应用市场图标
- 在输入框中搜索
Lua Booster
- 点击安装
Lua Booster
命令行安装
- CTRL/CMD+p
- 复制/粘贴 或 输入
ext install operali.lua-booster
- ENTER
Demo/演示
Type Inference and Hover Info
类型推导与悬浮代码信息
Back to Top [回到顶部]
Auto Complete, IntelliSense and Code Template
自动完成/智能提示/代码模板
Back to Top [回到顶部]
Semantic Analysis and Static Checking
语义分析和静态检查
Back to Top [回到顶部]
Syntax Coloring and Code Outline
代码大纲与符号信息
Back to Top [回到顶部]
定义跳转与文档格式化
Back to Top [回到顶部]
Find Reference and Rename Symbol
引用查找与变量重命名
Back to Top [回到顶部]
Annotation
EmmyLua注解
Back to Top [回到顶部]
Syntax Coloring
自定义语法着色
Back to Top [回到顶部]
Setting UI
设置UI
Back to Top [回到顶部]
Debugger
调试器
了解更多LuaPanda调试器信息,请参考:LuaPanda
For more information about LuaPanda, please read: LuaPanda
Back to Top [回到顶部]
ATTENTION : After installing lua booster ,you can enjoy coding right away. You can simply stop reading the documentation right here. But if you want to learn more about the usage of lua booster, the following instructions provide advanced usage guidances.
Also, we have provided a great UI for you to quickly use and set functions below, check UI if you don't want to read docs.
注意 : 安装Lua booster 之后,你可以立即开始编码并体验lua booster 的特性。你可以在这里停止阅读文档。 但是如果你想要了解lua booster 的更多进阶用法,下方的内容提供了一个很好的指引。
我们也提供了一个很棒的UI来帮助你使用和配置我们的功能,如果你不想继续阅读文档,请查看UI。
Setting/配置详解
ctrl + shift + p open command box, type in open workspace setting
lua.booster.source.requireDirectory API Searching Path
- If API path is C:/API, then code
require('a.b.c') will refer to C:/API/a/b/c.lua. Reference lookup is in the following order:
- Path relative to the current directory workspace
- Directory path relative to the current file
- Relative to
lua.booster.requireDirectory
lua.booster.source.preload Preload directory. Let's see how lua booster starts
- Load and analyze lua standard library(within plugin)
- Load and analyze directories under
lua.booster.preload
- Load and analyze the opened workspace directory
lua.booster.source.excludes The file mode of avoiding search , generally used to avoid super large directory search
lua.booster.source.language config the language of the standard lib
ctrl + shift + p open command box, type in open user setting
lua.booster.highlight This command will lead you to the settings where you can configure the color of syntax highlight. We have currently provided dozens of colors for you to select. Check the select box and pick whichever color you like. You can see the changes in your lua files afterwards.
ctrl + shift + p 打开命令框, 输入 open workspace setting
lua.booster.source.requireDirectory API搜索路径
- 如果API 路径为 C:/API, 代码
require('a.b.c') 会引用到 C:/API/a/b/c.lua, 引用查找按以下顺序:
- 相对当前目录 workspace的路径
- 相对当前文件所在目录 路径
- 依次相对 lua.booster.requireDirectory
lua.booster.source.preload 预加载目录,这里解释下 lua booster 启动顺序
- 加载分析 lua 标准库(内置)
- 加载分析 lua.booster.preload 下目录
- 加载分析 已打开的工作目录(workspace 目录)
lua.booster.source.excludes 避免搜索的文件模式, 一般用于避免超大目录搜索
lua.booster.source.language 配置标准库语言
ctrl + shift + p 打开命令框, 输入 open user setting
lua.booster.highlight 以上命令会导航到设置lua booster语法着色的设置。我们提供了二十多个可选的颜色,你可以查看下拉列表并选择你喜爱的颜色。之后在 lua 文件中即可看到变化。
Back to Top [回到顶部]
Commands/命令详解
ctrl + shift + p open the command box, type in the following Commands:
lua booster reload
You can reload the symbol table when there is a problem with the symbol table
lua booster setting
Set the user configuration template.
lua booster open logger
Open log directory.
lua booster setting -> module
Customizable module lookup rules in user environment (TODO)
lua booster open lint
Command to open the lint directory for viewing and add lint rules to the directory.
ctrl + shift + p 打开命令框 输入以下命令:
lua booster reload
可在符号表发生问题时,重置符号表
lua booster setting
设置用户配置模板。
lua booster open logger
打开日志目录
lua booster setting -> module
用户环境可自定义的模块查找规则 (TODO)
lua booster open lint
命令打开lint目录查看, 在该目录添加 lint规则
Back to Top [回到顶部]
FAQ
require is not functioning,how to config the require path ?
ctrl + shift + p open the command box
- Type in
open workspace setting
- Set
lua.booster.requireDirectory , fill in your path
reload window, Restart or ctrl + shift + p -> lua booster reload
our project use Module instead require
ctrl + shift + p open the command box
- Type in ``lua booster setting`
- choose
module
- add procedure for
load

There are too many files and it loads too slowly.
ctrl + shift + p open the command box
- Type in
open workspace setting
- Set
lua.booster.includes. Fill in the file matching pattern. Note that it is the relative path of the working directory
- You can also set
lua.booster.excludes, fill in the exclude path
reload window, Restart, or ctrl + shift + p -> lua booster reload
How to customize lint ?
ctrl + shift + p open the command box
- Type in
open workspace setting
- Copy your own directories here.
- (Refer to the existing scripts in this directory for how to implement static code checking by yourself)
reload window,Restart, or ctrl + shift + p -> lua booster reload
Config lua std lib to other language
See the setting item lua.booster.document.language
How to ignore a specific lint rule or get it back?
Hover at the diagnostic info provided by lint/luacheck
In the floating window, click QuickFix, then click Ignore rule of ...
Then you can see the diagnostic disappeared and a setting item is added to lua.booster.lint.json.
To stop ignoring a ignored rule, open lua.booster.lint.json which is under .vscode directory.
Find the lint rule you want to stop ignoring, delete the item or simply change the value from false to true
reload window,Restart, or ctrl + shift + p -> lua booster reload
How to change lua formatter setting?
ctrl + shift + p open the command box
- Type in ``lua booster setting`
- choose
formatter
- read the js file and change the settings you wanna change.
require 没有效果,如何配置require路径
ctrl + shift + p 打开命令框
- 输入
open workspace setting
- 设置
lua.booster.requireDirectory 填入路径
reload window, 重启 或者 ctrl + shift + p -> lua booster reload
在项目里使用 Module 替代 require
ctrl + shift + p 打开命令框
- 输入 ``lua booster setting`
- 选择
module
- 填加用户模块查找例程

目录下太多文件,加载速度太慢
ctrl + shift + p 打开命令框
- 输入
open workspace setting
- 设置
lua.booster.includes, 填入文件匹配模式, 注意是工作目录相对路径
- 也可以设置
lua.booster.excludes, 填入排除路径
reload window, 重启, 或ctrl + shift + p -> lua booster reload重置
配置lua标准库中/英文
见配置项 lua.booster.document.language
如何定制静态代码检查
ctrl + shift + p 打开命令框
- 输入
open lint 打开lint目录
- 将你的目录拷贝到该目录
- (关于如何自已实现静态代码检查,可参考该目录已有脚本)
reload window, 重启, 或ctrl + shift + p -> lua booster reload重置
如何忽视某条静态检查规则或取消忽视它?
- 鼠标移至相关的
diagnostic上,点击QuickFix,之后点击Ignore rule of ...
- 可以看到对应的诊断提示已经消失,而且一条设置被加入到了
lua.booster.lint.json文件中。
- 如果想要取消忽视某条规则,打开
.vscode目录下的lua.booster.lint.json文件
- 找到想要恢复的规则,将对应的条目删除或者将字段的值由
false改为true
reload window,Restart, 或者 ctrl + shift + p -> lua booster reload
如何更改formatter的设置?
ctrl + shift + p 打开命令框
- 输入 ``lua booster setting`
- 选择
formatter
- 查看打开的js文件并对其做出更改
Back to Top [回到顶部]
Contributor
Back to Top [回到顶部]
Acknowledgement
Chinese translation from cloudwu
LuaPanda debugger provided LuaPanda, specially thanks to stuartwang's help
Type annotation rules from tangzx 阿唐 (also contribute to debugger)
Formatter provided by lua-formatter
Luacheck provided by luacheck
Thanks to the creators of Lua for the wonderful language experience
中文文档引用 云风的翻译
类型注解功能根据 阿唐 的 EmmyLua 规范 (阿唐亦对调试器帮助良多)
文档格式化来自 lua-formatter
lint功能集成 luacheck
debugger集成了 LuaPanda, 特别感谢作者 stuartwang 的贡献
感谢 Lua 的创作者带来美妙的语言体验
Back to Top [回到顶部]
Link
if you are a game developer, using Unreal Engine, and prefer Lua, you might interested in UnLua we developed and maintained
if your are using Unity Engine, and prefer Lua, you might interested in xlua we developed and maintained.
如果你是一个游戏开发者, 在 虚幻引擎 下使用 lua, 可以试用我们团队的 UnLua 。
如果你在 Unity Engine 环境下使用 Lua, 可以试用我们团队的 xlua 。
Back to Top [回到顶部]