A VSCode extension for YueScript
- Provides syntax-highlighting and snippets for
YueScript. - Supports loading
yueconfig.yuefile from the workspace as the compilation configuration file. - Automatic build to
.luafile on save (whenbuildis enabled in configuration). - Skip generating
.luaforyueconfig.yue(config-only file). - Includes an internal LuaLS bridge (LSP over stdio), so Yue diagnostics/completion/signature/hover/definition can work without opening generated
.luafiles. - Supports Yue-style completion probing for chained calls, including
.and\method call forms.
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: ""yuecommand available in PATH.- For LuaLS features, install
lua-language-server: LuaLS Install Guide
yuescript.luaLS.executablePath: optional explicit path tolua-language-server(leave empty for auto-detection).yuescript.luaLS.parameters: optional extra command line args passed to LuaLS.
LuaLS analysis for a Yue file is fully enabled only when all of the following are true in yueconfig.yue:
build: truereserve_line_number: truereserve_comment: true
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.
- Some word tokens may be colored incorrectly.