summaryrefslogtreecommitdiffhomepage
path: root/packaging
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-02 17:34:49 +0900
committerAdam Malczewski <[email protected]>2026-06-02 17:34:49 +0900
commit8d70db66d3f0046cdef5fbce2ce5a86eab0959ef (patch)
treece15598edf72e325b4079a36d468ae1de4152570 /packaging
parent370fce3aca9249fa11645206f6457c59354a1445 (diff)
downloaddispatch-8d70db66d3f0046cdef5fbce2ce5a86eab0959ef.tar.gz
dispatch-8d70db66d3f0046cdef5fbce2ce5a86eab0959ef.zip
fix(search_code): render prose snippets + make context work + path-is-file guard
Address bugs found by an end-to-end test of the tool: - HIGH: prose/text files (.md/.html/etc.) came back as bare headers with no snippet. cs's default 'auto' snippet mode emits a single 'content' string (no 'lines[]') for prose, which the renderer skipped. Force --snippet-mode=lines by default so every file type returns a lines[] window that renders. Also add a defensive 'content'-shape fallback in formatResults (+ widen the CsResult type) so a content result is never shown blank. - HIGH: the 'context' parameter was a no-op — cs ignores -C except in grep snippet mode. When context is supplied, switch to --snippet-mode=grep so -C actually widens the per-match window (verified 2 -> 26 lines); default (no context) keeps the richer lines window for code. - LOW: a 'path' pointing at a file (not a dir) silently returned 'No matches found' (cs --dir <file> => null). Now stat the path and return an explanatory error (file vs nonexistent), pointing at read_file for a file. - MEDIUM/doc: clarify snippet_length (prose-mostly) and context descriptions. Tests: +5 (prose rendering live + stubbed content-shape; context widening; path-is-file; path-nonexistent). Full suite 603 pass, biome + tsc green. Note: the EACCES spill failure seen in testing is pre-existing platform infra (truncate.ts SPILL_ROOT, shared by all tools), not part of this tool.
Diffstat (limited to 'packaging')
0 files changed, 0 insertions, 0 deletions