Skip to main content

Overview

Inlay hints show small labels inside your code without changing the file. They can show parameter names for positional arguments, inferred types for untyped locals, and index keys in large tables.

Types of hints

Parameter name hints

When calling a function, GLuaLS can show the parameter names next to each argument:
ents.Create(/*classname:*/ "prop_physics")
SetGlobalString(/*index:*/ "CurrentMap", /*val:*/ "gm_flatgrass")
Enable with hint.paramHint:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json
{
  "hint": {
    "paramHint": true
  }
}

Local type hints

Show the inferred type of untyped local declarations:
local ent /*: Entity*/ = ents.Create("base_gmodentity")
local name /*: string*/ = ent:GetName()
Enable with hint.localHint:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json
{
  "hint": {
    "localHint": true
  }
}

Array/table index hints

Show implicit numeric keys in table literals:
local t = {
    /*[1]:*/ "first",
    /*[2]:*/ "second",
    /*[3]:*/ "third",
}
Enable with hint.indexHint:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json
{
  "hint": {
    "indexHint": true
  }
}

Override hints

Show when a method overrides a parent class method:
function ENT:Think() --[[ override ]]
    -- ...
end
Enable with hint.overrideHint.

Closing end hints

Show which do...end or function...end block an end closes. This helps in nested code:
function MyAddon.LongFunction()
    for i = 1, 100 do
        if condition then
            -- ...
        end --[[ if condition ]]
    end --[[ for i = 1, 100 ]]
end --[[ function MyAddon.LongFunction ]]
Enable with hint.closingEndHint.

Global configuration

You can toggle each hint type. This example shows the available settings:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json
{
  "hint": {
    "paramHint": true,
    "localHint": false,
    "indexHint": false,
    "overrideHint": true,
    "closingEndHint": false,
    "closingEndHintControlFlow": false,
    "closingEndHintMinLines": 15,
    "enumParamHint": true,
    "metaCallHint": true
  }
}

Additional hint settings

SettingDefaultDescription
hint.enumParamHintfalseShow named enum values for numeric arguments matching enum types
hint.metaCallHinttrueShow call hints for __call metamethod invocations
hint.closingEndHintControlFlowfalseInclude control flow constructs in closing-end hints
hint.closingEndHintMinLines15Minimum number of lines before GLuaLS shows closing-end hints

Strict mode array index hints

strict.arrayIndex controls whether implicit numeric table keys are treated as strict index hints and diagnostics.
.gluarc.json
{
  "strict": {
    "arrayIndex": true
  }
}

Inline values

During a debug session, GLuaLS can show current local variable values beside the code, like an inline variable inspector:
local hp = ply:Health()  -- 75
local pos = ply:GetPos() -- Vector(512, 248, 64)
Enable with:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json
{
  "inlineValues": {
    "enable": true
  }
}

VSCode integration

When enabled, inlay hints appear inline in the editor. Choose which hint types to display in the settings panel. See Hints & Hover settings for the full reference.