Overview
Theworkspace section tells the language server which files to analyze, which files to ignore, and where to find external libraries. It also controls module resolution and file encoding.
Options
| Option | Type | Default | Description |
|---|---|---|---|
workspace.library | array | [] | External library paths to include in analysis (strings or objects) |
workspace.workspaceRoots | string[] | [] | Additional workspace root directories for multi-root setups |
workspace.ignoreDir | string[] | [] | Directory names to exclude from analysis |
workspace.ignoreDirDefaults | (string | object)[] | built-in list | Built-in directories and globs to ignore. Accepts legacy strings or override objects; see below. |
workspace.useDefaultIgnores | boolean | true | Whether to apply workspace.ignoreDirDefaults |
workspace.enableIsolation | boolean | false | Keep multi-root main workspaces isolated. Set to false to merge workspace configs into one global baseline (first workspace config wins scalar conflicts, arrays are unioned) while still allowing per-workspace file-scoped overrides. |
workspace.ignoreGlobs | string[] | [] | Glob patterns of files to exclude from analysis |
workspace.moduleMap | array | [] | Module path rewrite rules (regex patterns) |
workspace.encoding | string | "utf-8" | File encoding for all Lua files in the workspace |
workspace.enableReindex | boolean | false | Trigger a full workspace reindex when files change |
workspace.reindexDuration | integer | 5000 | Delay in ms before a reindex fires after a file change |
workspace.packageDirs | string[] | [] | Partial library load; only load package declarations from these dirs, not full analysis |
Library paths
workspace.library adds directories to analysis without treating them as project source. Use this for annotation files, dependencies, or other code you need to reference from your project.
This helps gamemodes such as Helix, where your schema needs to reference the “core” Helix gamemode. Add
../helix as a library path in your schema gamemode..gluarc.json
Ignore patterns
Exclude directories or files from analysis:.gluarc.json
garrysmod(Steam engine files)addons(other addons’ source, if not relevant to your project).gitout,build,dist
Ignore default overrides
workspace.ignoreDirDefaults lets you override, disable, or extend the built-in ignore defaults without replacing the whole list.
The list accepts two forms:
- Legacy strings: when the list contains only plain strings, those strings replace all built-in defaults (original behavior, backward compatible).
- Object entries: when any object entry is present, GLuaLS uses the built-in list as the starting point and applies each entry in turn.
| id | Default glob |
|---|---|
wire-expression2 | **/gmod_wire_expression2/** |
wire-expression-files | **/wire_expression*.lua |
tests | **/tests/** |
test | **/test/** |
| Field | Type | Description |
|---|---|---|
id | string | Stable identifier matching a built-in or a custom id. |
label | string | Optional human-readable label (informational only). |
glob | string | Glob pattern to apply. Omit when only using disabled. |
disabled | boolean | Set true to remove this built-in default from the workspace. |
.gluarc.json
.gluarc.json
.gluarc.json
moduleMap rewrites require paths to file paths using regex replacement. Use it when your project uses non-standard require patterns.
.gluarc.json
Workspace roots
If your Lua files are not at the repository root, specify the Lua root:.gluarc.json
require("mymodule") relative to lua/mymodule.lua.
File encoding
Most Lua files use UTF-8, but older addons may use a legacy encoding:.gluarc.json
"utf-8", "utf-16", "gbk", "latin1", "ascii".
VSCode extension settings
You can also configure these settings in VS Code settings with thegluals.* prefix:
| VSCode Setting | .gluarc.json Key | Type | Default | Description |
|---|---|---|---|---|
gluals.workspace.enableReindex | workspace.enableReindex | boolean | false | Enable reindex after file changes |
gluals.workspace.reindexDuration | workspace.reindexDuration | integer | 5000 | Delay before reindex (ms) |
gluals.workspace.workspaceRoots | workspace.workspaceRoots | array | [] | Additional workspace roots |