User:Ash/SRB2 Lua on VSCode
REPORT BUGS HERE: https://git.do.srb2.org/LJSonic/vscode-lua-srb2
This is a simple guide to get SRB2 Lua working on VSCode.
Thanks to LJ for making these tools available to us! THIS EXTENSION IS NOT COMPLETE, SO SOME DEFINITIONS MAY BE MISSING. (But it works well IMO)
This guide requires VSCode to be installed on your computer.
WARNING: MAY REQUIRE OTHER LUA LANGUAGE EXTENSIONS TO BE DISABLED.
Follow the guide step by step for best results.
First, download this file and decompress it:
VSCode-SRB2Lua-3.7.4.zip (should support Windows, Mac and maybe Linux depending on your distro)
Put the SRB2Defs Lua file in a place you won't have to move very often (for best results!).
Then, in VSCode, open your command palette (on PC: CTRL + Shift + P. on Mac: Command + Shift + P).
Type "install from VSIX":
Follow the prompt to install the SRB2Lua VSIX file.
When it's installed, go to your extensions and locate the SRB2 Lua extension. Then, click the gear icon to open its settings.
Once in settings, scroll down until you see "Lua > Workspace: Library".
From there, hit the "Add Item" button and point it to your SRB2Defs Lua file.
Any other Lua files you'd like the extension to reference are OPTIONAL.
Pictured is my setup, with the SRB2 defs file and 2 files I wanted the extension to load for me:
You may want to scroll to find "Lua > Workspace: Max Preload" and "Lua > Workspace: Preload File Size".
From there, increase their values so the library file doesn't get rejected by the extension. My settings are provided as a reference, but you can use any number that works (but the default is too small, I think):
You can optionally add SRB2 Lua specific symbols like continue
and slash comments //
under "Lua > Runtime: Nonstandard Symbol":
And that's it! You should be able to see it working in your Lua files:
Troubleshooting
If it does not work, try the following steps:
- Some web browsers seem to download SRB2Defs.lua with the wrong extension under some circumstances. Ensure it is not called SRB2Defs.lua.txt or some other extension instead.