-
Notifications
You must be signed in to change notification settings - Fork 12
Manual setup for SLua typechecking linting in VSCode
If you only want vscode to typecheck and lint your SLua code, and you don't care about syncing with the viewer or preprocessing, then you don't even need this plugin, as it doesn't do the 2 things you want. Here's how to replicate what this plugin does without needing to install this plugin, or connect to a viewer:
-
Install the Luau Language Server (
johnnymorganz.luau-lsp) extension in VSCode -
Open a new or existing workspace in VSCode.
-
Create a folder named
sl-vscode-pluginin your workspace's.vscodefolder. -
Download these 2 files from the lsl-definitions repository into
.vscode/sl-vscode-plugin: -
Create or edit
.vscode/settings.jsonand add the following (with commas as needed):Windows:
"luau-lsp.types.definitionFiles": { "sl-slua": ".vscode\\sl-vscode-plugin\\secondlife.d.luau" }, "luau-lsp.types.documentationFiles": [ ".vscode\\sl-vscode-plugin\\secondlife.docs.json" ]
Linux/Mac:
"luau-lsp.types.definitionFiles": { "sl-slua": ".vscode/sl-vscode-plugin/secondlife.d.luau" }, "luau-lsp.types.documentationFiles": [ ".vscode/sl-vscode-plugin/secondlife.docs.json" ]
You can follow similar steps to set up SLua typechecking and linting on any editor that luau-lsp supports. These are currently:
- Install the Selene (
kampfkarren.selene-vscode) extension in VSCode - Open a new or existing workspace in VSCode.
- Create a folder named
sl-vscode-pluginin your workspace's.vscodefolder. - Download secondlife_selene.yml from the lsl-definitions repository into
.vscode/sl-vscode-plugin - Create a file named
selene.tomlin the root of your workspace, with the following content:std = "luau+.vscode/sl-vscode-plugin/secondlife_selene"