Overview
Thecompletion section controls autocomplete suggestions. These options adjust snippet expansion, require insertion, and the postfix trigger character.
Options
| Option | Type | Default | Description |
|---|---|---|---|
completion.enable | boolean | true | Enable autocomplete entirely |
completion.callSnippet | boolean | true | Insert function calls as snippets with parameter placeholders |
completion.stagedCallSnippets | boolean | true | Use staged snippets for known GMod APIs (hook.Add, net.Receive, net.Start, etc.) |
completion.postfix | string | "@" | Trigger character for postfix completions. Options: "@", ".", ":" |
completion.autoRequire | boolean | true | Insert a require() statement when completing a symbol from another module |
completion.autoRequireFunction | string | "require" | Function name used when auto-inserting a require |
completion.autoRequireNamingConvention | string | "keep" | Convention for the local alias when auto-requiring. Options: "keep", "snake-case", "pascal-case", "camel-case", "keep-class" |
completion.autoRequireSeparator | string | "." | Separator used in the auto-generated require path |
completion.baseFunctionIncludesName | boolean | true | Include the function name in completions for base class functions |
Call snippets
WhencallSnippet is enabled, selecting a function in autocomplete inserts it with parameter placeholders:
Staged snippets
stagedCallSnippets enables split-stage completion for known GMod callbacks. After you accept a hook name, GLuaLS uses the expected hook signature and fills parameter names. Set false to use a generic placeholder.
Postfix completions
Postfix completions let you write a value and then trigger a structural completion after it:@ conflicts with your code style.
Auto-require
When you accept a completion from an imported module,autoRequire inserts a require() at the top of the file:
autoRequireFunction to your project’s custom loader if you use one:
.gluarc.json
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.completion.enable | completion.enable | boolean | true | Enable autocompletion |
gluals.completion.callSnippet | completion.callSnippet | boolean | true | Show call snippets |
gluals.completion.stagedCallSnippets | completion.stagedCallSnippets | boolean | true | Stage API call snippets |
gluals.completion.postfix | completion.postfix | string | "@" | Postfix trigger character |
gluals.completion.autoRequire | completion.autoRequire | boolean | true | Auto-insert require statements |
gluals.completion.baseFunctionIncludesName | completion.baseFunctionIncludesName | boolean | true | Include name in base function |
Example
.gluarc.json