The VS Code extension is a thin wrapper around a standard language server.
That server ships as its own binary, so any editor with an LSP client gets the
same completion, hover, diagnostics, go-to-definition, rename, formatting and
code lenses.
Install
That puts two commands on your path: glua for linting and
formatting, and glua-lsp for the language server. The wiki
dataset is bundled, so neither needs a network connection.
Check it starts:
Neovim
With nvim-lspconfig, define the
server once and attach it to Lua files inside Garry’s Mod projects.
If you already run lua_ls, both will attach to .lua files and you will get
two sets of completions. Either disable lua_ls for Garry’s Mod projects, or
gate this one on a marker only your addons have, such as addon.json.
Helix
In languages.toml:
Zed
In your settings, point the Lua language at the binary:
Sublime Text
With LSP installed, add to LSP.sublime-settings:
Anything else
The server speaks LSP over stdio and takes the usual transport flags
(--stdio, --node-ipc, --socket=<port>). Point your client at:
Settings
Editors that support workspace/configuration can send the same settings the
VS Code extension uses, under the glua key. Everything on the
configuration page applies.
If your client does not send configuration, the server falls back to its
defaults, and a committed .glua.json still
works — it is read from disk rather than from the editor.
What you do not get
Two things are VS Code commands rather than language server features, so they
are unavailable elsewhere:
- The net message graph (
GLua: Show Net Message Graph), which renders in a
webview
- The realm status bar item and its click-to-toggle activation
Diagnostics, completion, hover, signature help, go-to-definition, references,
rename, document and workspace symbols, code actions, inlay hints, formatting,
code lenses and semantic tokens all work the same.