Skip to main content

Overview

The runtime, strict, doc, and references sections control how the language server interprets Lua syntax and checks types.

Runtime (runtime.*)

OptionTypeDefaultDescription
runtime.extensionsstring[][]Additional file extensions to treat as Lua (e.g., ".lua.txt")
runtime.requireLikeFunctionstring[][]Functions that behave like require for module resolution
runtime.requirePatternstring[][]Require path resolution patterns (e.g., "?.lua", "?/init.lua")
runtime.versionstringLuaJITLua version for runtime behavior (not used in GLuaLS)
runtime.nonstandardSymbolstring[]see belowNon-standard Lua syntax tokens to accept (not used in GLuaLS)
runtime.frameworkVersionsstring[][]Framework version identifiers
runtime.specialobject{}Map function names to special behaviours

Default non-standard symbols

GLuaLS enables these non-standard symbols by default to match GLua syntax:
["//", "/**/", "continue", "!=", "||", "&&", "!"]
All available non-standard symbols:
SymbolDescription
//Integer division operator
/**/Block comments (C-style)
`Backtick strings
+=, -=, *=, /=, %=, ^=, //=Compound assignment operators
|=, &=, <<=, >>=Bitwise compound assignment
||, &&, !, !=C-style logical operators
continuecontinue statement (not in standard Lua 5.1)

Special functions

Map custom function names to built-in semantic behavior:
.gluarc.json
{
  "runtime": {
    "special": {
      "include": "require",
      "my_assert": "assert",
      "my_type": "type"
    }
  }
}
Available behavior values: "none", "require", "error", "assert", "type", "setmetatable"

Strict mode (strict.*)

OptionTypeDefaultDescription
strict.requirePathbooleanfalseEnforce strict require() path validation
strict.arrayIndexbooleanfalseEnforce strict array index usage
strict.metaOverrideFileDefinebooleantrueAllow meta (annotation) file definitions to override file-level definitions
strict.docBaseConstMatchBaseTypebooleantrueAllow base constants (e.g., 0, "") to match their base type
strict.requireExportGlobalbooleanfalseRequire explicit ---@export global annotation for globals to be visible outside their file
strict.allowNullableAsNonNullablebooleantrueAllow optional types (T?) to be passed where non-optional (T) is expected (lenient nil-safety)
strict.inferredTypeMismatchbooleanfalseReport type mismatch diagnostics for inferred values (stricter checker, may produce false positives)

Enabling stricter nil checking

.gluarc.json
{
  "strict": {
    "allowNullableAsNonNullable": false,
    "inferredTypeMismatch": true
  }
}

Documentation format (doc.*)

OptionTypeDefaultDescription
doc.syntaxstring"md"Documentation syntax: "md", "myst", "rst", "none"
doc.knownTagsstring[][]Custom annotation tags to suppress unknown-doc-tag warnings for
doc.privateNamestring[][]Field name patterns to treat as private (e.g., ["m_*", "_*"])

Custom tag suppression

.gluarc.json
{
  "doc": {
    "knownTags": ["realm", "hook", "accessorfunc"]
  }
}

Private field naming patterns

.gluarc.json
{
  "doc": {
    "privateName": ["m_*", "_*", "__*"]
  }
}

References (references.*)

OptionTypeDefaultDescription
references.enablebooleantrueEnable find references
references.fuzzySearchbooleantrueFall back to fuzzy matching if exact search finds nothing
references.shortStringSearchbooleanfalseSearch for variable/function name references inside strings

Document color (documentColor.*)

OptionTypeDefaultDescription
documentColor.enablebooleantrueShow color pickers for Color(r, g, b) and similar calls

VSCode extension settings

You can also configure these settings in VS Code settings with the gluals.* prefix:
VSCode Setting.gluarc.json KeyTypeDefaultDescription
gluals.references.enablereferences.enablebooleantrueFind all references
gluals.references.fuzzySearchreferences.fuzzySearchbooleantrueFuzzy search for references
gluals.references.shortStringSearchreferences.shortStringSearchbooleanfalseSearch strings for references

Full example

.gluarc.json
{
  "runtime": {
    "nonstandardSymbol": ["//", "/***/", "continue", "!=", "||", "&&", "!"],
    "requireLikeFunction": ["include"],
    "special": {
      "include": "require"
    }
  },
  "strict": {
    "allowNullableAsNonNullable": true,
    "inferredTypeMismatch": false
  },
  "doc": {
    "privateName": ["m_*", "_*"]
  }
}