Skip to main content

Overview

The workspace 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


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.
Each entry is either a path string or an object with per-library ignore options:
.gluarc.json

Ignore patterns

Exclude directories or files from analysis:
.gluarc.json
Common directories to ignore for GMod projects:
  • garrysmod (Steam engine files)
  • addons (other addons’ source, if not relevant to your project)
  • .git
  • out, 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:
  • Strings replace the built-in list with your own patterns.
  • Objects change, remove, or add individual entries while keeping the rest of the built-in list.
Built-in default ids: Object entry fields: Disable a single built-in:
.gluarc.json
Override a built-in pattern and add a custom entry:
.gluarc.json
Disable all built-in defaults globally:
.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
This affects require path resolution. GLuaLS resolves 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
Available values: "utf-8", "utf-16", "gbk", "latin1", "ascii".

VS Code extension settings

You can also configure these settings in VS Code settings with the gluals.* prefix: