This is a Lua Language Server library for CC: Tweaked's APIs.
Before the fork, this was intended to be used in Visual Studio Code with Sumneko's Lua extension (sumneko.lua
). This fork concentrates on making completions for ComputerCraft a first-class citizen in editors such as Neovim, Vim, and Emacs.
- Download the repository
- If you don't already have one, create a folder, wherever you'd like, that can contain all your third-party libraries for Sumneko's Lua extension.
- In this folder, create a new folder named
CC-Tweaked
or something similar. - Paste the contents from this repo in this new
CC-Tweaked
folder. - Open VS Code and open the settings
- In the searchbar, type:
@ext:sumneko.lua third party library
- Select
Add Item
- Paste in the absolute path to the folder containing all of your libraries from step 2 (the one that contains the
CC-Tweaked
folder) - Then to enable third party libaries click on
Edit in settings.json
underCheck Third Party
and set"Lua.workspace.checkThirdParty": true
Now when you trigger one of the below cases you should be prompted to set up your workspace as a CC:Tweaked
workspace.
Trigger cases:
- Following phrases are found in file:
turtle.<something>
rednet.<something>
redstone.<something>
peripheral.<something>
minecraft
computercraft
- File is named:
startup.lua
After applying the workspace, you should have full autocompletion and diagnostics.
Note
CC: Tweaked has some seriously cursed support for Lua features, thus, the environment is a little messy and is not currently emulated as accurately as possible. As time goes on, we can figure out what is and isn't supported in CC:Tweaked and remove unsupported features using config.json
from the built-in libraries of Sumneko's Lua extension.