Laravel Debug Remover
Find and safely remove configurable PHP, Laravel, and Blade debug calls. The extension understands nested and multiline function arguments and ignores calls written inside strings or comments.
Features
- Remove debug calls from the current PHP or Blade file.
- Preview matches across the workspace before changing anything.
- Confirm workspace-wide removal before edits are applied.
- Skip
vendor, node_modules, storage, and bootstrap/cache by default.
- Keep embedded PHP syntactically valid by replacing a debug expression with
null instead of deleting surrounding code.
- Opt into legacy PHP, Kint, and termination calls separately.
Commands
- Remove Debug Statements (Current File) —
Ctrl+Shift+D on Windows/Linux or Cmd+Shift+D on macOS.
- Find Debug Statements (Entire Workspace) — lists the number of matches in each file without modifying files.
- Remove Debug Statements (Entire Workspace) — previews the result and asks for confirmation before removal.
Supported calls
Enabled by default:
dd($value);
dump($value);
ddd($value);
ray($value);
Blade forms such as @dd(...), {{ dd(...) }}, {!! dump(...) !!}, and @php(dd(...)) are also supported.
Optional groups:
- Legacy PHP:
var_dump, print_r, debug_zval_dump, var_export
- Kint:
d, s, Kint::dump
- Application termination:
die(...), exit(...)
Termination calls are disabled by default because they may be intentional application behavior. Output statements such as echo and printf, and logging calls, are deliberately not removed automatically.
Settings
{
"removeDebugStatements.excludePatterns": [
"**/vendor/**",
"**/node_modules/**",
"**/storage/**",
"**/bootstrap/cache/**"
],
"removeDebugStatements.includeLegacyPhp": false,
"removeDebugStatements.includeKint": false,
"removeDebugStatements.includeDangerous": false
}
Development
npm test
This compiles TypeScript, runs ESLint, and executes the detector regression fixtures.
Requirements
- VS Code 1.75.0 or newer
- PHP or Blade files