Skip to main content

Overview

@fileparam sets a default type for any parameter with the same name in the current file. Functions without an explicit @param for that name use the file-level default.

Syntax


Usage


Precedence

If GLuaLS cannot infer the parameter type from the function signature or owning type, it checks these sources in order:
  1. Explicit @param annotation on the function itself
  2. @fileparam for the current file
  3. gmod.fileParamDefaults in .gluarc.json: workspace-wide defaults

Override with @param

If one function in the file needs a different type for the same parameter name, add @param to that function:

Workspace defaults

Set defaults for all files in the workspace:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json

Common patterns

GMod addons reuse parameter names such as ply, attacker, and victim. Use @fileparam or workspace defaults to avoid repeated @param annotations: