VS Code extension
Install the fallow extension for VS Code to see findings as you edit, with its commands, settings and binary resolution.
You write code in VS Code, and an export that nothing uses stays there until a CI job or a reviewer finds it. With the fallow extension, the finding shows while you edit. In the demo project, the Problems panel lists Export 'cancelOrder' is unused for src/services/orders.ts, and a quick fix removes the export.
The extension starts fallow-lsp, the language server of fallow. The server runs the same analysis as the CLI and CI, so the editor shows the findings that the CI job reports.
Before you start
- VS Code 1.96 or later.
- A JavaScript or TypeScript project. Install its dependencies, because fallow reads the packages in
node_modules.
Steps
-
Install the extension. Search for "fallow" in the Extensions view, or run:
code --install-extension fallow-rs.fallow-vscode -
Open the project folder. The extension finds or downloads
fallow-lsp, and runs the first analysis. -
Open the Fallow view in the activity bar to see the findings by type.
On the first install, a Getting Started walkthrough opens. To open it again, use the Command Palette.
What you get
The extension shows each finding in the place where you work on the code:
- Diagnostics. Each finding shows in the editor and in the Problems panel. The code of a diagnostic, for example
unused-export, links to its documentation. - Code lens. Above each used export,
imported by N filesshows how many files import it. Click it to see the imports. - Hover. An export shows the number of files that import it. Duplicated code shows the other places of the clone group.
- Quick fixes. Remove an unused export, delete an unused file, or copy the finding id of a finding. On
cancelOrder, the quick fix isRemove unused export `cancelOrder`. The extension offers this quick fix only when the open file parses, and only when each name of the declaration is unused. - Sidebar views. Unused Code, Duplicates, Health, Security Candidates and Runtime Coverage. The Security Candidates view is off by default. The Runtime Coverage view stays empty until you load a capture.
- Status bar. One Fallow item shows the finding count and the health grade. Its hover gives the counts by type and the audit verdict of your change. A click opens a menu.
- Config file support. Autocomplete and validation for
.fallowrc.json.
The extension reads the config file of the project, so the editor reports the same findings as the CLI. To hide one type in the editor only, set it to false in fallow.issueTypes.
Show only the findings of new code
An old project can have hundreds of findings, and then a new finding of your own change is hard to see. Run Fallow: Set Baseline at HEAD. The command creates the local git tag fallow-baseline at HEAD and sets fallow.changedSince to it. The editor then shows only the findings in files that changed after the tag. The command does not push the tag.
Binary resolution
The extension needs a fallow-lsp binary, and the version of that binary decides which findings you see. It looks for the binary in this order:
- The
fallow.lspPathsetting. - The
node_modulesof the workspace, from a development dependency onfallow. PATH.- A binary that the extension downloaded before.
- A download from the GitHub release, when
fallow.autoDownloadis on. Otherwise the extension asks you.
A development dependency in the project comes before PATH and the download, so it gives the editor the same version as the CLI and CI. The extension verifies the Ed25519 signature of each binary that it downloads, and does not install a binary without a valid signature.
Check the result
Run Fallow: Show Output Channel. The lines that start with Binary resolution: name the binary that the extension uses, and where it found the binary. With fallow in the project, the line starts with Binary resolution: using local node_modules:. The Fallow item in the status bar shows the finding count after the first analysis.
If it fails
- No diagnostics. Open the output channel and read the binary resolution lines. When the extension found no binary, install fallow in the project, or set
fallow.lspPath. configured LSP path ... does not point to a fallow-lsp binary. Correctfallow.lspPath, or clear it to use the automatic resolution.- The editor shows other findings than the CLI. Check
fallow.production,fallow.changedSinceandfallow.issueTypes. These settings apply only to the editor. - A diagnostic does not update. Fallow updates the diagnostics when you save a file. Run Fallow: Restart Language Server when they stay old.
Reference
Commands
Run each command from the Command Palette.
| Command | ID |
|---|---|
| Fallow: Run Analysis | fallow.analyze |
| Fallow: Reload Health | fallow.health.reload |
| Fallow: Scan for Security Candidates | fallow.analyzeSecurity |
| Fallow: Inspect Active File | fallow.inspectActiveFile |
| Fallow: Inspect Symbol at Cursor | fallow.inspectActiveSymbol |
| Fallow: Set Baseline at HEAD | fallow.setBaselineAtHead |
| Fallow: Select Workspace Scope... | fallow.selectWorkspace |
| Fallow: Clear Workspace Scope (Analyze All) | fallow.clearWorkspace |
| Fallow: Load Runtime Coverage | fallow.loadCoverage |
| Fallow: Reload Runtime Coverage | fallow.reloadCoverage |
| Fallow: Clear Runtime Coverage | fallow.clearCoverage |
| Fallow: Audit Changed Files | fallow.audit |
| Fallow: Auto-Fix (unexport unused, remove unused deps) | fallow.fix |
| Fallow: Preview Fixes (Dry Run) | fallow.fixDryRun |
| Fallow: Restart Language Server | fallow.restart |
| Fallow: Show Output Channel | fallow.showOutput |
| Fallow: Open Sidebar | fallow.openSidebar |
| Fallow: Open Settings | fallow.openSettings |
| Fallow: Enable Security Candidates | fallow.enableSecurity |
| Fallow: Enable Health View | fallow.enableHealth |
| Fallow: Toggle Hide Code-Duplication Findings | fallow.toggleMuteDuplicates |
| Fallow: Toggle Hide All Findings | fallow.toggleAllDiagnostics |
| Fallow: Show Status Menu | fallow.showStatusMenu |
| Fallow: Manage Hidden Findings... | fallow.manageDiagnosticMutes |
| Fallow: Show All Findings | fallow.clearDiagnosticMutes |
| Fallow: Reset Hidden Findings (Restart Server) | fallow.resetDiagnosticFilters |
| Fallow: Activate License | fallow.license.activate |
| Fallow: Show License Status | fallow.license.status |
| Fallow: Refresh License | fallow.license.refresh |
| Fallow: Deactivate License | fallow.license.deactivate |
Settings
| Setting | Default | Description |
|---|---|---|
fallow.lspPath | empty | Path to the fallow-lsp binary. |
fallow.configPath | empty | Path to a Fallow config file. |
fallow.allowRemoteExtends | false | Allow the language server to load trusted https:// config inheritance. |
fallow.typeAware.enabled | false | Refine Fallow's project-wide public API analysis with TypeScript symbol identity. |
fallow.typeAware.projects | [] | Optional tsconfig paths for type-aware analysis. |
fallow.typeAware.require | best-effort | Choose whether incomplete semantic evidence stays advisory or fails the analysis after emitting its conservative result. |
fallow.typeAware.timeoutSeconds | 0 | Wall clock in seconds allowed for one semantic request, forwarded to the CLI as FALLOW_TYPE_AWARE_TIMEOUT_SECS. |
fallow.autoDownload | true | Automatically download managed fallow-lsp and fallow CLI binaries if not found. |
fallow.issueTypes | each type on | Toggle individual issue types on or off. |
fallow.duplication.threshold | 0 | Maximum allowed duplication percentage before the analysis is marked as failing. |
fallow.duplication.minTokens | 50 | Minimum token count for a clone before it can be reported as duplicated code. |
fallow.duplication.minLines | 5 | Minimum line count for a clone before it can be reported as duplicated code. |
fallow.duplication.minOccurrences | 2 | Minimum number of occurrences (instances of the same clone) before a group is reported. |
fallow.duplication.mode | mild | Duplication detection mode. |
fallow.duplication.near | false | Detect function-scoped near-miss clones with small structural edits in addition to exact clones. |
fallow.duplication.skipLocal | false | Only report duplicate code that appears across different directories. |
fallow.duplication.crossLanguage | false | Compare TypeScript and JavaScript files after stripping TypeScript type annotations. |
fallow.duplication.ignoreImports | true | Exclude import declarations from duplicate-code detection. |
fallow.duplication.ignoreSymlinks | false | Omit clone instances whose path is a symlink or lies under a symlinked directory. |
fallow.production | auto | Production mode for the sidebar tree and the editor diagnostics (they stay in sync). |
fallow.coverage.capturePath | empty | Path to a local runtime-coverage capture (a file or directory). |
fallow.coverage.top | 0 | Show only the top N hot paths and findings in the Runtime Coverage view (mirrors the CLI's --top). |
fallow.changedSince | empty | Show only issues in files changed since the given git ref. |
fallow.packageBaselines | true | Apply the per-package refs of workspaces.changedSince from the Fallow config. |
fallow.health.enabled | true | Show the Fallow Health view (score and grade, complexity findings, hotspot candidates, refactoring candidates). |
fallow.health.hotspots | true | Show git churn hotspots in the Health view. |
fallow.health.topFindings | 20 | Maximum number of complexity findings shown in the Health view (passed to fallow health --top). |
fallow.health.statusBar | true | Show the project health score and grade in the Fallow status bar item. |
fallow.health.inlineComplexity | true | Show a compact complexity lens (N cyc, N cog) above functions that exceed Fallow Health thresholds. |
fallow.complexity.breakdownEnabled | true | Show the inline complexity breakdown in the editor: a per-line marker and hover that explain WHY a function scored high (each else if, nested if, boolean operator, loop, ... with its cyclomatic/cognitive weight), plus a CRAP explanation on the function line. |
fallow.complexity.afterText | false | Always show the dim per-line +N complexity breakdown for every complex function, instead of only the function you expand (via its lens) or select in the Health view. |
fallow.complexity.decorationCap | 200 | How many top complexity findings to fetch for inline editor decorations when the breakdown is enabled. |
fallow.workspace | empty | Scope Fallow's sidebar analysis to a single monorepo workspace package, by name. |
fallow.audit.gate | new-only | Which findings affect the audit verdict shown in the editor. |
fallow.audit.worsened | auto | How an inherited complexity finding that got worse affects the audit verdict shown in the editor. |
fallow.audit.statusBar.enabled | true | Show the audit verdict (pass/warn/fail) for the current change set in the Fallow status bar item: a warning or error background, an icon and a hover line. |
fallow.audit.runOnSave | false | Re-run the audit verdict automatically when a JS/TS file is saved. |
fallow.diagnostics.severity | warning | Render Fallow editor diagnostics at the selected VS Code severity. |
fallow.diagnostics.mutedCategories | [] | Team-shareable baseline of Fallow diagnostic categories to hide in the editor, such as code-duplication or stale-suppression. |
fallow.trace.server | off | Trace level for the LSP server communication. |
fallow.security.enabled | false | Surface local security candidates (client-server-leak, the tainted-sink CWE catalogue) from fallow security in the Security Candidates sidebar view. |
fallow.license.showStatusBar | true | Show the license state in the Fallow status bar item, but only when license material is present. |
fallow.license.refreshOnStartup | false | Probe license status once when the extension activates. |