This extension integrates the Optiprune dead code analyzer into Visual Studio Code. It provides real-time diagnostics and a dedicated command to scan your workspace for unreachable files, dead exports, and unused dependencies.
Features
Real-time Analysis: Automatically scans files on save to detect dead code.
SARIF Support: Uses high-precision SARIF output for accurate error reporting.
SMT-Aware: Highlights code that is logically unreachable (e.g., if (false) branches).
Problems List: All findings are listed in the VS Code "Problems" panel.
Usage
Open a TypeScript or JavaScript project.
Ensure optiprune is installed (locally or globally).
Run the command Optiprune: Scan for Dead Code from the Command Palette (Ctrl+Shift+P).
View findings directly in the editor or the Problems panel.
Requirements
optiprune must be available in your project's node_modules or globally via npx.
Extension Settings
Currently, the extension uses default settings. Future versions will support custom entry points and root directories.