Set up VSCode so your .luau files get autocomplete and type checks.
You get the geode.d.luau type stub, place it in your mod, then point the Luau language server at it.
The example mod template
already contains .luaurc, .vscode/settings.json, and the /types/ ignore rule.
If you used it, complete step 1-3 then skip to step 7.
Install VSCode and the Luau Language Server extension, luau-lsp by JohnnyMorganz.
Download geode.d.luau from the LuauAPI releases tab.
It sits next to the .geode mod file. No build is needed.
If you build LuauAPI from source instead, the stub is written to types/ after a build.
See Building from source.
For what the stub contains, see type stubs.
Put geode.d.luau in a types/ folder at your mod root, so the path is types/geode.d.luau.
Create .luaurc in your mod root.
{
"languageMode": "strict",
"aliases": {
"types": "types"
}
}Create .vscode/settings.json in your mod root.
The stub is large, so the fflags override stops type-check errors about code complexity.
{
"luau-lsp.platform.type": "standard",
"luau-lsp.types.definitionFiles": {
"@geode": "types/geode.d.luau"
},
"luau-lsp.ignoreGlobs": [
"**/*.d.luau"
],
"luau-lsp.fflags.sync": false,
"luau-lsp.fflags.override": {
"LuauTarjanChildLimit": "0",
"LuauTypeInferIterationLimit": "0",
"LuauNormalizeCacheLimit": "0",
"LuauTypeInferRecursionLimit": "1000",
"LuauVisitRecursionLimit": "1000"
}
}The stub is generated output, not source. Add this to your mod .gitignore.
# LuauAPI types
/types/
Reload the VSCode window, open a .luau file, and type geode. to confirm autocomplete works.
For a quick sanity check, geode.Mod.getID() should show hover type string.
When LuauAPI updates its bindings, download the new geode.d.luau from the release tab and replace your copy.
The definitionFiles entry is a fixed single path, so you only reload after a swap.
.luaurctools/luau_codegen/emit/luau_types/CMakeLists.txt