Skip to content

Language server

Studio serves the Language Server Protocol (LSP) over TCP on 127.0.0.1:6009 while a project is open, with the same type checker and live place as the built-in script editor. Change the port in Preferences > General under Language Server Port; 0 turns the server off.

The language server knows every engine global, library, system and component, picking the server or client definitions from a script's .server.luau, .client.luau, .server.lua or .client.lua name. It also knows the entities of the open place as children of World and of their parents, and self of each attached script.

Point any LSP client that speaks TCP at 127.0.0.1:6009 for luau and lua files. In Neovim:

vim.api.nvim_create_autocmd("FileType", {
    pattern = { "luau", "lua" },
    callback = function(ev)
        vim.lsp.start({
            name = "luduvo",
            cmd = vim.lsp.rpc.connect("127.0.0.1", 6009),
            root_dir = vim.fs.root(ev.buf, { "world.ldv" }),
        })
    end,
})

Headless language server

For continuous integration or tools without a window, start Studio with --headless and --lsp; --lsp=0 picks a free port. Once the project has loaded, Studio prints the address to standard output:

LuduvoEditor --headless path/to/project --lsp=0
LSP listening on 127.0.0.1:41733