Skip to content

ImpactLens reference

Documentation sections

Commands

Command Purpose
ImpactLens: Analyze Current ChangesAnalyzes supported current Git changes; when the Git list is empty, it may use an active supported file inside the workspace.
ImpactLens: Analyze PR ChangesAnalyzes the diff between a resolved base branch and HEAD.
ImpactLens: Check SetupChecks the Python interpreter and analyzer location.
ImpactLens: RefreshResets and reloads Current Changes and Pull Requests in the sidebar.
ImpactLens: Analyze All ChangesQuick Pick for analyzing, previewing, or copying all supported tracked changes.
ImpactLens: Analyze Change FileQuick Pick for analyzing, opening, or copying the path of the selected file.
ImpactLens: Analyze Pull RequestQuick Pick for analyzing or previewing a PR, opening or copying its URL, and explicitly fetching a missing ref.

Settings

Key Value
impactlens.pythonPathA string containing the path to Python 3.11+; an empty value enables automatic discovery.
impactlens.git.baseBranchA string containing the Git ref or branch name for PR analysis; an empty value enables automatic resolution.
impactlens.analysis.defaultDepthDefault analysis depth: 1, 2, 3, or all; the default is 2.
impactlens.analysis.excludeAn array of glob patterns that exclude files and directories from static analysis; empty by default.
impactlens.analysis.maxAffectedSymbolsMaximum displayed code elements; 1000 by default.
impactlens.analysis.maxSuggestedTestsMaximum suggested tests; 100 by default.
impactlens.ai.baseUrlA string containing the base URL of an OpenAI-compatible API; an empty value disables AI suggestions.
impactlens.ai.apiKeyA string containing the configured provider's API key; it is stored as an ordinary VS Code setting.
impactlens.ai.apiKeyEnvVarThe environment variable containing the API key when impactlens.ai.apiKey is empty; OPENAI_API_KEY by default.
impactlens.ai.modelA string containing the provider's model identifier.
impactlens.ai.experimentalKodikBridgeExperimental Kodik AI bridge; disabled by default.

Set the API key directly through impactlens.ai.apiKey or use an environment variable named by impactlens.ai.apiKeyEnvVar. Restart VS Code or Kodik after changing a system environment variable.

Open Open Settings from Getting Started or the ImpactLens extension settings. Under ImpactLens: Analysis, use Analysis depth, Exclude patterns, and Result limits for code elements and tests. On large projects, start with Fast check or Normal analysis and a depth of 1–3 levels instead of all dependency levels.

Python discovery order

  1. impactlens.pythonPath.
  2. <workspace>/.venv/Scripts/python.exe.
  3. <workspace>/.venv/bin/python.
  4. <workspace>/backend/.venv/Scripts/python.exe.
  5. <workspace>/backend/.venv/bin/python.
  6. py -3.
  7. python.
  8. python3.

Each candidate is checked with a short Python invocation; the first one that runs successfully is selected.

Supported languages

Group Extensions Support level Tests and command
Python .py ast: imports, functions, classes, and methods; FastAPI routes; pytest test_*.py; pytest <file>
TypeScript/JavaScript .ts, .tsx, .js, .jsx Relative imports, functions, arrow functions, and classes; no routes *.test.*, *.spec.*; npm test -- <file>
Go .go Package imports, functions, and struct/interface; no routes *_test.go; go test ./...
Java .java import, class/interface, and methods through lightweight heuristics; no routes *Test.java; mvn test -Dtest=<ClassName>
C# .cs using, class/interface, and methods through lightweight heuristics; no routes *Tests.cs; dotnet test
C/C++ .c, .cc, .cpp, .h, .hh, .hpp #include, functions, and class/struct through lightweight heuristics; no routes *_test.c, *_test.cpp, test_*.c, test_*.cpp; ctest

Python/FastAPI has the richest support. The other groups are intended for conservative file-level navigation and test selection, not complete semantic language analysis.

Git and pull requests

Pull request listing and analysis use an available VS Code GitHub integration or GitHub CLI. If a PR branch is unavailable locally, the extension offers an explicit fetch and does not replace the missing ref with a guess.

Current changes are combined from git diff --name-status --diff-filter=ACMR HEAD and the equivalent staged diff with --cached. Added, copied, modified, and renamed tracked files are supported; the normal flow excludes deleted and untracked files.

For general PR analysis, base resolution follows this order: impactlens.git.baseBranch, the base from gh pr view, the origin/HEAD symbolic ref, then main, master, develop, origin/main, origin/master, and origin/develop. Comparison uses the three-dot diff <base>...HEAD.

When a PR is selected in the sidebar, its base/head refs are used. If a ref is not available locally, the user can explicitly fetch pull/<number>/head into impactlens/pr-<number> and continue.

AI, privacy, and external boundaries

Core impact analysis runs locally and does not call an LLM. A manual AI request sends these compact analysis facts to the configured OpenAI-compatible provider: changed_files, affected_files, file_impacts, affected_routes, affected_symbols, and suggested_tests. Fix failed tests additionally sends compact run results; the entire project source is not included in the standard payload.

The user sets the base URL, model, and API key. The API key is stored as an ordinary VS Code setting. To obtain a PR list, ImpactLens may contact the GitHub API through an existing VS Code session or run the local gh command; these calls are separate from static analysis.

Current limitations

  • Conservative analysis: the graph operates at file level and is not a type-aware call graph. The reported scope may be broader than the actual scope, and every symbol in an affected file may be shown as affected.
  • Untracked files: the normal changed-files workflow uses Git diff and does not see untracked files until they are added to the index; an active supported file is available only as a separate fallback for the Current Changes command.
  • Routes: only Python FastAPI routes are extracted. The TypeScript/JavaScript, Go, Java, C#, and C/C++ adapters do not extract framework routes.
  • Multi-root: the extension uses the first open workspace folder and does not combine multiple workspace roots.
  • Parsing: Python uses ast and requires syntactically parseable files; the other languages use regex heuristics and may miss complex or unusually formatted code.
  • Ambiguous resolution: matching module and file names, aliases, dynamic imports, and cross-language connections are not resolved perfectly; a suffix heuristic may select a conservative candidate.
  • Performance: analysis time depends on project size, depth, and exclusions. Repeat runs may be faster because of local optimizations, but large repositories should configure depth and exclude patterns.
  • Sample projects: the browser FastAPI/React demo uses the local samples/ directory, focuses on Python/FastAPI, and does not represent the extension's full multilingual flow.
  • Guarantees: the report helps focus review, but it does not replace testing, dynamic analysis, or expert verification and does not guarantee discovery of every runtime effect.