Skip to content

chore: remove dead Copilot inspection code#1661

Merged
chagong merged 1 commit into
microsoft:mainfrom
chagong:chore/remove-dead-copilot-inspection
Jun 10, 2026
Merged

chore: remove dead Copilot inspection code#1661
chagong merged 1 commit into
microsoft:mainfrom
chagong:chore/remove-dead-copilot-inspection

Conversation

@chagong

@chagong chagong commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

Removes the entire src/copilot/ directory — the Copilot-powered Java "inspection" feature (LLM-generated suggestions rendered as code lenses, gutter icons, ruler highlights, and diagnostics).

Why

The feature's activation entry was removed from extension.ts in #1343 (shipped in v0.27.0), but the implementation itself was left in the tree as unreferenced dead code. On the current main:

  • Nothing outside src/copilot/ imports any of these modules.
  • activateCopilotInspection is defined but never called.
  • There are no package.json command/menu/configuration contributions pointing at it (those were removed in remove entry of Copilot related features. #1343).
  • The java.copilot.* commands are only registered programmatically inside the never-invoked activation path.

So the code can never run today. Removing it reduces bundle size and eliminates confusion.

Scope / safety

  • Deletes only src/copilot/** (15 files).
  • No dependency changes needed: lodash and vscode-extension-telemetry-wrapper remain used elsewhere in the extension.
  • No package.json contribution changes needed (none referenced this feature).

Validation

  • npx tsc --noEmit — passes.
  • npm run compile (webpack) — builds successfully.

The Copilot-powered Java inspection feature under src/copilot was disabled in microsoft#1343 (v0.27.0) by removing its activation entry from extension.ts, but the implementation was left behind as unreferenced dead code. Nothing in the extension imports it, no command/menu contributions reference it, and it never runs.

Remove the entire src/copilot directory. Build and typecheck pass; no dependency or package.json contribution changes are needed (lodash and the telemetry wrapper remain used elsewhere).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the previously deactivated Copilot-powered Java “inspection” feature implementation by deleting the entire src/copilot/** subtree, reducing bundle size and eliminating dead/unreachable code paths.

Changes:

  • Delete the Copilot inspection core (chat wrapper + inspection orchestration and caching).
  • Delete all inspection UI renderers (CodeLens, diagnostics, gutter icons, ruler highlights) and command wiring.
  • Delete related symbol utilities used only by the removed feature.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/copilot/utils.ts Removes Copilot inspection utilities (symbol/range helpers, telemetry wrappers, LM API readiness checks).
src/copilot/Copilot.ts Removes the Copilot chat wrapper used by the inspection feature.
src/copilot/inspect/SymbolNode.ts Removes the DocumentSymbol wrapper used for inspection targeting/caching.
src/copilot/inspect/Inspection.ts Removes the inspection data model and indicator-range helper.
src/copilot/inspect/InspectionCache.ts Removes inspection caching keyed by document/symbol snapshots.
src/copilot/inspect/InspectionCopilot.ts Removes the inspection engine that prompts the model and parses suggestions.
src/copilot/inspect/commands.ts Removes command registrations for inspect/fix/ignore flows.
src/copilot/inspect/index.ts Removes the (now-dead) activation entrypoint and dependent-extension waiting logic.
src/copilot/inspect/DocumentRenderer.ts Removes renderer management and rerender/debounce logic for inspection UI.
src/copilot/inspect/InspectActionCodeLensProvider.ts Removes the “Rewrite with new Java syntax” class-level CodeLens provider.
src/copilot/inspect/render/InspectionRenderer.ts Removes the shared renderer interface used by inspection UI implementations.
src/copilot/inspect/render/CodeLensRenderer.ts Removes inspection CodeLens rendering implementation.
src/copilot/inspect/render/DiagnosticRenderer.ts Removes diagnostic publishing + code action generation for fixes.
src/copilot/inspect/render/GutterIconRenderer.ts Removes gutter icon decoration rendering and fix-command hover wiring.
src/copilot/inspect/render/RulerHighlightRenderer.ts Removes overview ruler highlight decoration rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chagong chagong merged commit bc56820 into microsoft:main Jun 10, 2026
103 of 104 checks passed
@chagong chagong deleted the chore/remove-dead-copilot-inspection branch June 10, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants