gabriel / muse public
feat symbols main #19 / 100

feat(symbols): polish muse code symbols command

- Remove dead-code duplication: replace private _symbols_for_snapshot, _is_semantic, and _language_of with imports from _query.py. The private _language_of rebuilt its lookup dict on every call (perf bug); the shared language_of keeps it as a module-level constant.

- Add --language filter (present in every analogous command — grep, stable, hotspots, clones, compare — but missing from symbols).

- Validate --kind immediately; invalid values now error with the full list of accepted kinds instead of silently returning zero results.

- Make --count and --json mutually exclusive at the argparse level.

- Add TTY-aware ANSI color output: bold file paths, blue fn, bold-yellow class, cyan method, dim line numbers and hashes.

- Expand language_of() map in _query.py to cover all tracked file types (Markdown, TOML, YAML, JSON, CSS, SCSS, HTML, SQL, Shell, Swift, Protobuf, Terraform) — fixes display in every command that calls it.

- Human-friendly summary line: thousand separators, proper pluralization (symbol/symbols, file/files), comma-separated language breakdown.

- Fix help text: correct title (muse code symbols), remove third-party references, add live ANSI color to the example, replace RST double- backtick markup with bold ANSI flag names.

- Add 15 new tests in TestSymbols covering all flags, invalid inputs, JSON schema, mutual exclusion, and edge cases.

G Gabriel Cardona <gabriel@tellurstori.com> · 21h ago Mar 23, 2026 · dc734ff5 · parent b5d8116d
3
files changed
414
files in snapshot
Files Changed 414 in snapshot
~3

0 comments

No comments yet. Be the first to start the discussion.