Overview
GLuaLS supports VGUI, GMod’s panel GUI system. It understandsvgui.Create() calls and the panel inheritance hierarchy, and it provides IDE features for VGUI development.
Panel type inference
When you callvgui.Create("Type"), GLuaLS types the returned value as the matching panel class:
Code lens
Whengmod.vgui.codeLensEnabled is true, GLuaLS shows code lens annotations above panel creations and definitions.
Enable in .gluarc.json:
.gluarc.json
Inlay hints for :Add()
When using panel:Add("Type"), GLuaLS shows the panel type in an inlay hint:
Custom panels
GLuaLS understands the standard VGUI inheritance pattern used to define custom panels:vgui.Register(name, PANEL, base), GLuaLS recognizes "MyPanel" in later vgui.Create("MyPanel") calls. The panel type includes all methods from the PANEL table plus inherited DPanel methods.
Derma controls and skins
GLuaLS also understandsderma.DefineControl, derma.DefineSkin, derma.GetNamedSkin, derma.GetSkinTable(), and panel skin setters:
Custom wrappers
If your framework wraps VGUI or Derma APIs, annotate the wrapper parameters with@call_arg. This lets GLuaLS recognize the wrapped calls without matching the wrapper by name.
Scripted Entity Explorer
The Scripted Class Explorer lists VGUI panels for navigation. Click a panel class in the explorer to open its definition.VSCode integration
VGUI features work after the extension starts. The Class Explorer sidebar shows registered panel types under the Classes section. Configure VGUI support in the settings panel. See GMod settings for the full reference.Configuration
| Setting | Default | Description |
|---|---|---|
gmod.vgui.codeLensEnabled | true | Show code lens on panel creations/definitions |
gmod.vgui.inlayHintEnabled | false | Show inlay hints for panel:Add() type inference |