Luau LSP Integration
RbxSync automatically generates configuration files for Luau LSP, giving you full intellisense, type checking, and autocomplete in VS Code.
Automatic Setup
When you extract a game, RbxSync creates a project.json file in your project root:
{
"name": "YourGame",
"tree": {
"$path": "src",
"Workspace": { "$path": "src/Workspace" },
"ReplicatedStorage": { "$path": "src/ReplicatedStorage" },
"ServerScriptService": { "$path": "src/ServerScriptService" }
}
}This file tells Luau LSP how your folder structure maps to Roblox services.
Features You Get
With Luau LSP configured:
- Autocomplete: Full intellisense for Roblox APIs and your own modules
- Type Checking: Catch type errors before testing in Studio
- Go to Definition: Jump to module definitions across your codebase
- Hover Info: See type signatures and documentation on hover
- Find References: Find all usages of a function or variable
Installing Luau LSP
- Install the Luau LSP extension in VS Code
- Extract your game with RbxSync (creates
project.jsonautomatically) - Open your project folder in VS Code
- Luau LSP will detect the project and start providing intellisense
Manual Sourcemap Generation
If you need to regenerate the sourcemap manually:
rbxsync sourcemapThis creates sourcemap.json which provides additional path resolution for the LSP.
Troubleshooting
LSP Not Working
- Check that
project.jsonexists in your project root - Verify the Luau LSP extension is installed and enabled
- Reload VS Code window (
Cmd+Shift+P→ "Reload Window")
Wrong Service Paths
If autocomplete suggests wrong paths, your project.json may be out of date. Re-extract or run:
rbxsync sourcemap --regenerateRojo Compatibility
If you have an existing default.project.json from Rojo, Luau LSP will use that instead. RbxSync's project.json uses the same format, so both tools work together.
VS Code Settings
For the best experience, add to your .vscode/settings.json:
{
"luau-lsp.sourcemap.enabled": true,
"luau-lsp.types.roblox": true
}