Editor Setup
How to set up Visual Studio Code with autocomplete, type checking and documentation for the nanos world API.

Installing
- Download and install Visual Studio Code.
- Install the nanos world Lua extension. It will also install the Lua extension (Lua Language Server), which it depends on.
- Open your Package folder (or your whole
Packages/folder) in VS Code with File -> Open Folder. - Open any
.luafile. The extension downloads the latest nanos world API annotations and configures the Lua Language Server to use them.
C'est terminé ! Now you get autocomplete for all Classes, methods, events and enums, and you can hover them to read their documentation.
The annotations are generated automatically from the same API files used to build this documentation, and are downloaded when the extension starts, so an internet connection is required to get the latest version.
Tips
Annotating your own Code
The Lua Language Server understands LuaCATS annotations. Adding them to your functions and classes gives you autocomplete and type checking for your own code too:
---Gives money to a Player
---@param player Player The Player to receive it
---@param amount number How much money
---@return number The new balance
function GiveMoney(player, amount)
local new_balance = player:GetValue("money", 0) + amount
player:SetValue("money", new_balance, true)
return new_balance
end
For your inherited classes, you can declare them as a subclass of the nanos world class, so all its methods are suggested:
---@class Crate : Prop
Crate = Prop.Inherit("Crate")
Which Side am I?
The editor can't know if a file runs on the Server or on the Client, so it will suggest all methods. Always check the Authority of methods and events in this documentation when writing code in Shared/ files.