Skip to main content

Overview

GLuaLS understands VGUI panel creation, registration, and inheritance. A created panel keeps both its registered type and the standard panel methods inherited from its parent.

Panel type inference

When you call vgui.Create("Type"), GLuaLS types the returned value as the matching panel class:

Code lens

When gmod.vgui.codeLensEnabled is true, GLuaLS shows code lens annotations above panel creations and definitions. Enable in .gluarc.json:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.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:
After vgui.Register(name, PANEL, base), GLuaLS recognizes "MyPanel" in later constructors. The panel type includes methods from the PANEL table and inherited DPanel methods.

Derma controls and skins

GLuaLS also understands derma.DefineControl, derma.DefineSkin, derma.GetNamedSkin, derma.GetSkinTable(), and panel skin setters:
Skin names support completion, hover, references, and go-to-definition in the same way as panel names.

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.

Class Explorer

The Scripted Class Explorer lists VGUI panels for navigation. Click a panel class in the explorer to open its definition.

VS Code 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 Garry’s Mod settings for the full reference.

Configuration