Skip to content

chore: remove dead console functions (batch 10)#18820

Merged
dsyme merged 2 commits intomainfrom
dead10
Feb 28, 2026
Merged

chore: remove dead console functions (batch 10)#18820
dsyme merged 2 commits intomainfrom
dead10

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Feb 28, 2026

Removes 14 dead functions from pkg/console/ and one dead function from pkg/cli/:

pkg/console/

  • FormatLocationMessage, FormatCountMessage, FormatListHeader (console.go)
  • RenderTree, buildLipglossTree, renderTreeSimple (console.go / render.go)
  • RenderTableAsJSON (render.go)
  • PromptInput, PromptInputWithValidation (input.go)
  • NewIndeterminateProgressBar (progress.go)
  • SpinnerWrapper.IsEnabled (spinner.go)
  • MoveCursorUp, MoveCursorDown (terminal.go)

pkg/cli/

  • renderMCPHierarchyTree (mcp_tool_table.go) — called only console.RenderTree

Removed pkg/console/terminal_test.go entirely and cleaned up exclusive tests in 6 other test files.

Copilot AI review requested due to automatic review settings February 28, 2026 11:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes a batch of unused console/CLI helper functions and the associated test coverage, reducing surface area and dependencies in pkg/console and pkg/cli.

Changes:

  • Deleted multiple unused console helpers (tree rendering, JSON table rendering, cursor movement, input helpers, indeterminate progress bar, spinner enabled check) and removed now-dead imports.
  • Removed renderMCPHierarchyTree from the CLI MCP tool table code since it depended on the removed console tree renderer.
  • Deleted/trimmed related tests, including removing pkg/console/terminal_test.go.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/console/terminal_test.go Removed tests for dead terminal cursor helpers.
pkg/console/terminal.go Removed dead cursor movement functions.
pkg/console/spinner_test.go Removed tests/logic that depended on deleted IsEnabled.
pkg/console/spinner.go Removed dead SpinnerWrapper.IsEnabled.
pkg/console/render.go Removed dead JSON table renderer and simple tree renderer helper.
pkg/console/progress_test.go Removed tests for deleted indeterminate progress bar factory.
pkg/console/progress.go Removed dead NewIndeterminateProgressBar.
pkg/console/input_test.go Removed tests for deleted input helpers.
pkg/console/input.go Removed dead PromptInput* helpers.
pkg/console/golden_test.go Removed golden coverage for deleted tree/location formatting.
pkg/console/console_test.go Removed unit tests for deleted location/tree/JSON functions.
pkg/console/console_formatting_test.go Removed tests and calls for deleted formatting helpers.
pkg/console/console.go Removed dead formatting helpers and tree rendering implementation/import.
pkg/cli/mcp_tool_table_test.go Removed tests for deleted MCP hierarchy tree renderer.
pkg/cli/mcp_tool_table.go Removed dead MCP hierarchy tree renderer.

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

Comment on lines 621 to 623
// findWordEnd finds the end of a word starting at the given position
func findWordEnd(line string, start int) int {
if start >= len(line) {
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

renderTreeSimple was removed, but the js/wasm implementation (pkg/console/console_wasm.go) still calls renderTreeSimple from RenderTree. This will break js/wasm builds with an undefined symbol error. Either restore renderTreeSimple in a file that is included for js/wasm builds, or update/remove the wasm RenderTree implementation to no longer depend on it.

Copilot uses AI. Check for mistakes.
@dsyme dsyme merged commit 98cf8b6 into main Feb 28, 2026
48 checks passed
@dsyme dsyme deleted the dead10 branch February 28, 2026 12:21
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.

2 participants