Configuration
All settings are under the mago.* namespace in your VS Code settings.json. The extension reads these at activation and responds to changes in real time.
Mago also reads
mago.tomlfor formatter and linter configuration. Extension settings control the VS Code integration behavior;mago.tomlcontrols mago's own rules, presets, and excludes.
mago.enabled
booleantrueMaster switch for the entire extension. When false, all features are disabled — no formatting, no diagnostics, no status bar. Useful for temporarily disabling Mago without uninstalling.
mago.bin
string"" (auto-detect)Absolute path to the mago binary. When set, the extension skips auto-detection and uses this path directly. The binary must be executable.
When left empty, the extension searches in order:
./vendor/bin/mago(Composer local)./mago(workspace root)- System
$PATH
See Binary Resolution for the full search order.
mago.configPath
string"" (auto-detect)Path to a custom mago.toml configuration file. When empty, mago searches the workspace root automatically.
This is useful when your config lives outside the workspace root, or when you want to use different configurations for different tasks.
mago.phpVersion
string"" (use mago default)Override the PHP version used for parsing and analysis. Accepts version strings like "8.2" or "8.3". This overrides both the php-version key in mago.toml and the MAGO_PHP_VERSION environment variable.
mago.lint.enabled
booleanfalseEnable or disable lint diagnostics. When enabled, the extension runs mago lint and displays results in the Problems panel. When disabled, the lint diagnostic collection is cleared.
mago.lint.run
"onSave" | "onType""onSave"Controls when the linter runs:
onSave— Lint when the file is saved. Lower resource usage, no flicker.onType— Lint as you type, with a 300ms debounce. Provides faster feedback but runs the CLI more frequently.
Since mago is a CLI tool (not an LSP),
onTypemode spawns a process on each debounced change. For large files or slow machines,onSaveis recommended.
mago.analyze.enabled
booleanfalseEnable or disable static analysis diagnostics. The analyzer runs mago analyze alongside the linter and displays results in the same Problems panel, but in a separate diagnostic collection.
mago.format.enabled
booleantrueRegister Mago as a PHP formatting provider. When enabled, you can use Mago with VS Code's "Format Document" command and format-on-save. When disabled, the formatter is unregistered.
mago.trace.level
"off" | "error" | "warn" | "info" | "debug""info"Controls log verbosity in the Mago output channel (View → Output → select "Mago"). Useful for troubleshooting.