✨ Features
- Language support for BWLua
- Autocomplete for BedWars Scripting API and Roblox primitives
- Syntax highlighting
- Typechecking
- Annotations
- Hover details on variables and functions
- Project generation
- [COMING SOON] Automatically sync scripts between VS Code and the Roblox script editor
🔨 Installation
Download and install the extension through the VS Code marketplace. The marketplace can be accessed through the Extensions
tab in VS Code or directly in your browser.
📓 Project Generation
Open the Command Palette with Ctrl+Shift+P
and run the command BedWars Scripting Toolkit: Generate New Project
. Running this command will prompt the user for a project name, create a new project, and open it in a new VS Code window.
Opening any .lua
file in the new project will produce the following prompt
Select Apply and modify settings
.
The location of the project is determined by the global user setting BedWarsScriptingToolkit.projectDir
. If the setting does not exist when the command is executed, an os agnostic directory will be chosen. This can be modified in your user settings.
🔧 Migrating Existing Projects
Create bwconfig.lua
in an existing project directory to enable the language addon for the entire workspace. (This only needs to happen once per workspace, the addon will stay enabled across sessions unless explicitly disabled)
Select Apply and modify settings
when the configuration prompt appears.
🔄 Code Sync
The Code Sync panel should immediately open when the extension activates (If it doesn't, run the BedWars Scripting Toolkit: Code Sync
command). Generate a token in the Sync
tab of the BedWars script editor and paste it into the {sync-token}
input field and press the connect button. If the connection fails an error notification will pop up with the reason. Once you're connected, all of the .lua
files in your workspace will be synced over the the BedWars script editor if a syncGlob
is not specified. If you would only like to sync specific files, you can add a syncGlob
key that points to a glob pattern in your bwconfig.lua
.
☔ Troubleshooting
I'm not seeing the "Configure your work environment" prompt
- Make sure the
Lua
extension by sumneko
is enabled (The Lua extension is bundled with this extension). If it is not enabled, enable it and restart VS Code.
- Check if the global user setting
Lua.workspace.userThirdParty
exists and is pointing at {HOME_DIR}/LuaAddons
. If it does not exist, try manually adding the setting.
- You may have other Lua extensions that are creating conflicts. Try disabling them and restarting VS Code.
The extension installation is failing
- Ensure that your VS Code version is greater than or equal to
1.76.0
. If it isn't, update and restart VS Code.
"X" Luau syntax is not supported
- We currently partially support a subset of Luau specific syntax (
continue
, compound assignment, string interpolation, and more) but because of a bug in the Lua Language Server extension, some of these features are not properly enabled in BWLua projects. Follow the status of the bug here. A temporary workaround is to navigate to .vscode/settings.json
in your project workspace and set Lua.runtime.nonstandardSymbol
's value to ["`", "+=", "-=" "*=", "/=", "^=", "continue"]
. Expect general improvements in the future.