A native stdio language server and VS Code extension for LuauXTX. The server
uses the official Luau parser, typechecker and incremental frontend through a
pinned luau-lsp engine. It performs
static analysis without starting LuauXTX or XTPKG.
Install
Install the VSIX for your OS/architecture using Extensions: Install from VSIX
or code --install-extension luauxtx-0.1.0-win32-x64.vsix. The executable,
28 native-module declarations and language client ship together; no server
download or runtime installation is needed for analysis.
Build targets are Windows x64, Linux x64, macOS x64 and macOS arm64. The local
artifact is the Windows x64 build; other targets are built/tested by CI when it
runs. Standalone server ZIPs include definitions and licenses for other editors.
Open a folder containing xtpkg.toml, or any .luau file. Project .lua files
are recognized when their nearest parent contains an XTPKG manifest. Standalone
.lua files retain VS Code's existing language association. Multi-root folders
have independent analysis configurations and module graphs.
Disable other Luau language servers for this workspace to avoid duplicate results.
Use LuauXTX: Show Server Output for startup failures. Unsupported platform
builds can select a separately built native executable with luauxtx.lsp.path.
Semantic features
Completion, inferred types, contextual table properties, hover documentation,
signature help, definitions, references, semantic rename, diagnostics, symbols,
semantic tokens and inlay hints come from Luau analysis. Auto-imports insert
real require() declarations and preserve existing imports. Rename refuses an
edit that would modify an installed packages/ dependency. Package types come
from their own source; untyped dynamic exports cannot acquire invented types.
--!strict
local fs = require("@luauxtx/system/fs")
local gfx = require("@luauxtx/gfx")
local source: string = fs.readSync("xtpkg.toml")
local font = gfx.loadFont(nil, 16)
local width, height = gfx.measureText(source, font)
Native names are taken from LuauXTX's lib/ inventory. Explicit @luauxtx/
always selects a native module. Legacy system/fs first checks the importer's
relative file, matching the runtime. process, Promise, task, fs and http
globals are typed too. Native declarations are parsed, never executed.
XTPKG projects
Run xtpkg add xtest explicitly, then require("xtest") works immediately.
The resolver walks from the importing file to the nearest
packages/.xtpkg-imports.json, then parent directories. Scoped names, nested
dependency maps, exact entrypoints and canonical file identities match LuauXTX.
Invalid nearest records block fallback. Paths cannot escape their packages.
Map, manifest, lockfile and module watches invalidate analysis without restart.
The extension validates the scalar TOML format actually accepted by XTPKG,
including package fields, dependency ranges, scripts and executable declarations.
It reads existing lock/import metadata and bounded local registry/cache metadata;
it never requests registry data from the network. Package names, local entries,
hover and navigation are available in manifests. Missing dependencies offer an
explicit install action. xtpkg.lock remains controlled by XTPKG.
Typed packages expose their usual exported contracts. For example, the companion
XTGUI source exports application options, components, callbacks and generic state:
local gui = require("xtgui")
local app = gui.createApp({title="Example",width=800,height=600})
local count = gui.state(0)
app:render(function()
return gui.Button({text="Increment",onClick=function()
count:update(function(value) return value+1 end)
end})
end)
app:run()
Commands and settings
The command palette provides restart/output, select runtime, run current file,
initialize project, install/add/update dependencies, run a selected manifest
script and open installed package documentation. These actions require workspace
trust and an explicit command. Runtime and package-manager detection reads PATH
and known launchers without running them. Native processes receive argument arrays
through VS Code process tasks, including paths containing spaces.
| Setting |
Default |
luauxtx.lsp.enabled |
true |
luauxtx.lsp.path |
auto (bundled server) |
luauxtx.runtime.path, luauxtx.xtpkg.path |
auto |
luauxtx.analysis.mode |
strict (nonstrict, nocheck also supported) |
luauxtx.analysis.diagnostics |
true |
luauxtx.analysis.maxFiles |
5000, maximum 10000 |
luauxtx.completion.autoImports |
true |
luauxtx.inlayHints.enabled, .variableTypes |
true |
luauxtx.inlayHints.parameterNames |
literals (none, all) |
luauxtx.inlayHints.returnTypes |
false |
luauxtx.formatting.enabled |
true |
luauxtx.formatting.path |
auto (StyLua on PATH) |
luauxtx.trace.server |
off (messages, verbose) |
Luau --!strict/--!nonstrict/--!nocheck directives override the workspace
default. .luaurc supports normal declarative Luau lint/type configuration;
runtime resolution does not use Luau aliases. .config.luau and Luau plugins
are never executed. Formatting uses an existing StyLua executable with stdin,
cancellation, a timeout and version checks. Missing StyLua is reported; it is
never installed automatically. Use normal VS Code format-on-save settings.
Other editors
Launch luauxtx-lsp lsp using JSON-RPC/LSP over stdio; stdout is protocol only.
Keep the adjacent definitions/ directory. Send workspace configuration under
luau-lsp (the engine wire namespace); xtxAnalysisMode selects the default
checking mode. Register watches for .luaurc, Lua files, xtpkg.toml,
xtpkg.lock and packages/.xtpkg-imports.json. The server advertises dynamic
watches if the client supports them. The VS Code manifest provider and commands
are client-side conveniences; semantic Luau features remain editor-independent.
Build and test
Requirements: Python 3.10+, Git, CMake 3.24+, C++17 compiler, Node 22+ and npm.
Windows needs MSVC C++ build tools/SDK; Unix needs a C++ compiler and build tool.
Bootstrapping and npm installation access the network. Normal analysis does not.
python scripts/bootstrap.py
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target luauxtx-lsp ResolverTests --parallel 4
ctest --test-dir build -C Release --output-on-failure
python tests/integration.py --server build/bin/luauxtx-lsp
python tests/native_types.py --server build/bin/luauxtx-lsp
npm ci --prefix vscode --ignore-scripts
npm run test:unit --prefix vscode
python scripts/package.py --server build/bin/luauxtx-lsp
npm run test:integration --prefix vscode
On Windows append .exe to server paths. scripts/package.py --stage-only
prepares the development extension without producing a VSIX. Extension-host
tests use a separate temporary profile; XTX_TEST_VSCODE can select an installed
VS Code executable. Otherwise @vscode/test-electron downloads its test editor.
See architecture, validation,
contributing/releasing, and the
ecosystem demonstration.
Dependencies and runtime API revisions are pinned in dependencies.json.
After reviewing native API changes, update the module declarations and run
python scripts/definitions.py --runtime ../LuauXTX --record. CI uses the same
script without --record to reject API drift. Update the runtime revision too
when intentionally changing the supported API baseline.
Boundaries
This is static analysis, not runtime execution. Dynamic JSON and deliberately
dynamic package APIs retain any; package-specific types must live in packages.
There is no implicit package installation, project plugin execution, telemetry,
debugger or package publishing. StyLua is optional and separate.
Indexing skips build/VCS/vendor scratch directories and symlink directories. It
is bounded to 50,000 visited entries, three seconds of enumeration, 64 MiB of
enumerated source and 10,000 indexed files per root. Individual source files are
limited to 2 MiB and import maps to 2 MiB. Open-buffer protocol messages are
limited to 32 MiB. Index limits can make whole-workspace reference/rename results
partial; directly imported modules are still resolved on demand. Index work runs
in small idle batches and gives queued editor requests priority. References and
rename report that indexing is in progress until it completes. Fragment
autocomplete is disabled after a reproduced stale-result bug; the incremental
Luau dependency frontend remains enabled. Cross-platform CI is provided; local
validation results are documented separately from CI targets.
Remaining improvements include broader platform/soak coverage, richer documentation
on individual native members, a broader code-action test corpus and better types
in dynamic third-party packages. This server cannot infer an accurate API from
arbitrary runtime metaprogramming without package-side annotations. The native
CLI currently reports the upstream engine version (1.70.1); extension/distribution
version metadata is 0.1.0. Release workflows prepare drafts; no publishing happens
during development or normal installation.