Warning
This method is deprecated in favor of using Lua Language Server packages; please see the primary maintainer's writeup for details on how to set this up.
This includes a standard library for use with Selene on CC: Tweaked, as well as globals definitions for the Lua Language Server.
Selene is an extensible Lua linter written in Rust, and Lua Language Server is the backend to the Lua plugin in VSCode (as well as being the de-facto language server for Lua in other editors and IDEs, such as Neovim and Emacs).
You might also be interested in StyLua, a Lua formatter written in Rust. Its configuration is not included here because formatting configurations are typically highly opinionated.
Do you have a screenshot of your editor with this configuration? Open an issue to get it added here!
Press the "Use this template" button in the top right of the GitHub page. You probably want to replace the README.md and LICENSE files with your own.
The Justfile
file is not strictly necessary for this configuration to work; it is merely for convinience.
When cloning, make sure to pass the --recurse-submodules
flag. (If you forgot to do that, run git submodule sync
.)
Copy .gitmodules
, .luarc.json
, cc-tweaked.yaml
, and selene.toml
to the root of your project.
Update your submodules with git submodule sync
.
Optionally, copy the provided Justfile
to allow easily running Selene.
You can add additional Lua LS libraries by:
- Adding the library's source repository as a submodule in
.lua-ls-defitions/meta/3rd/<submodule-name>
. - Adding
$SUBMODULE_LOCATION
+/library
to line 7 of.luarc.json
's array.
See the wiki page for a list of all Lua LS libraries intended for ComputerCraft.
Any globals defined in cc-tweaked.yaml
are set as read-only to prevent accidents.
You probably don't want this if you're writing an operating system that replaces these globals.
- @carsakiller for CC: Tweaked's Lua Language Server library.
- @MasonGulu and @Autist69420 for becoming early users of this configuration set.
- You, because you are awesome for reading that entire document.