YueScript
(yuescript-vscode)

A VSCode extension for YueScript
read the documentation here 🔗
Features
- Provides syntax-highlighting and snippets for
YueScript.
- Supports loading
yueconfig.yue file from the workspace as the compilation configuration file.
- Automatic build to
.lua file on save (when build is enabled in configuration).
- Skip generating
.lua for yueconfig.yue (config-only file).
- Includes an internal LuaLS bridge (LSP over stdio), so Yue diagnostics/completion/signature/hover/definition can work without opening generated
.lua files.
- Supports Yue-style completion probing for chained calls, including
. and \ method call forms.
Configuration
The extension supports loading a yueconfig.yue file from your workspace. This file allows you to configure how the extension compiles your Yuescript code. Create a yueconfig.yue file in your workspace with the following format:
-- create a `yueconfig.yue` file in your workspace with the following options
return
-- Whether the vscode extension should build the code to Lua file on save.
build: false
-- The search paths to be included when compiling the code. The search paths are relative to the `yueconfig.yue` file.
include:
- "Lib"
-- The global variables to be recognized by the extension.
globals:
- "Dora"
-- Whether the compiler should collect the global variables appearing in the code.
lint_global: true
-- Whether the compiler should do an implicit return for the root code block.
implicit_return_root: true
-- Whether the compiler should reserve the original line number in the compiled code.
reserve_line_number: true
-- Whether the compiler should reserve the original comment in statement in the compiled code.
reserve_comment: true
-- Whether the compiler should use the space character instead of the tab character in the compiled code.
space_over_tab: false
options:
-- The target Lua version to compile the code.
target: "5.5"
-- The path to be appended to the `package.path` for the compiler.
path: ""
Requirements
yue command available in PATH.
- For LuaLS features, install
lua-language-server: LuaLS Install Guide
Extension Settings
yuescript.luaLS.executablePath: optional explicit path to lua-language-server (leave empty for auto-detection).
yuescript.luaLS.parameters: optional extra command line args passed to LuaLS.
LuaLS Enable Conditions
LuaLS analysis for a Yue file is fully enabled only when all of the following are true in yueconfig.yue:
build: true
reserve_line_number: true
reserve_comment: true
Use Project Library Definitions With LuaLS
To make LuaLS load your project-provided type/library definition files, add a .luarc.json in the workspace root:
{
"workspace.library": [
"./Script/Types",
"./Script/Meta"
]
}
If you also use third-party LuaLS addon packages, you can set:
{
"workspace.userThirdParty": [
"./.luals"
]
}
After updating .luarc.json, reload VSCode (or restart the extension host) to ensure LuaLS picks up the new library paths.
Known Issues
- Some word tokens may be colored incorrectly.