Cfx Lua IntelliSense — FiveM & RedM

About this fork
This extension is a community fork of the archived overextended/cfxlua-vscode project. The original is no longer maintained; this fork is kept up to date and published for the community.
It is maintained independently and published under the SlantingStds namespace on both the Open VSX Registry and the Visual Studio Marketplace.
This extension is not authored, published, sponsored, nor endorsed by Cfx.re.
Why use this fork?
- Actively maintained — The original overextended extension is archived; this fork receives updates and remains available.
- Available everywhere — Install from both Open VSX (e.g. VSCodium) and the Visual Studio Marketplace (VS Code, Cursor).
- Drop-in replacement — Same IntelliSense, native definitions, and runtime globals as the original; you can switch without changing your workflow.
What this extension provides
- Smart editing for Lua — Diagnostics, hover info, and auto-completion via sumneko's Lua Language Server.
- Cfx runtime globals — Environment APIs such as
CreateThread, promises, json, and statebags are recognized and completed.
- Game natives, always up to date — Type definitions and IntelliSense for FiveM, RedM, and CFX natives, generated on your machine straight from the official native documentation (
static.cfx.re and VORPCORE/RDR3natives) and cached locally. Definitions refresh automatically about once a week; run CfxLua: Update natives to refresh on demand.
- LuaGLM support — Types and support for Cfx's Lua implementation (LuaGLM): vectors, quaternions, and matrices, plus limited power patches support.
Note: Some power patches have been reported to cause crashes; use with care.
Screenshots


Configuration
| Setting |
Options |
Description |
cfxlua.game |
gtav, rdr3 |
Choose GTA V or RDR3 natives. |
Commands (Command Palette):
- CfxLua: Use GTAV natives — Switch to GTA V natives.
- CfxLua: Use RDR3 natives — Switch to RDR3 (RedM) natives.
- CfxLua: Update natives — Re-download and regenerate the native definitions immediately.
How natives work
Native definitions are not bundled with the extension. On first activation the extension downloads the official native JSON documentation, generates Lua annotation stubs from it, and caches them in the extension's global storage. Only the active game's natives (plus the shared CFX natives) are fetched.
- First activation needs an internet connection. If you are offline, runtime globals still work; native IntelliSense activates after the first successful download (use the status-bar button or CfxLua: Update natives to retry).
- Definitions are re-checked about every 7 days (cheap conditional requests — nothing is re-downloaded unless the docs changed).
- If you need a fully offline install, grab the
.vsix from a GitHub Release once and let the extension cache the natives while online — the cache persists across updates.
Credits
Thanks to Cfx, gottfriedleibniz and alloc8or.
The native stub generator is derived from rage-lua-types by ImBaphomettt (MIT). RDR3 native data comes from VORPCORE/RDR3natives.