Skip to content

tools: add top-level export outline to read_file auto-preview#490

Merged
esengine merged 1 commit into
mainfrom
feat/487-read-file-symbol-outline
May 9, 2026
Merged

tools: add top-level export outline to read_file auto-preview#490
esengine merged 1 commit into
mainfrom
feat/487-read-file-symbol-outline

Conversation

@esengine

@esengine esengine commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

When read_file auto-preview fires (file > 200 lines, no head / tail / range given), the head 80 + tail 40 slice doesn't cover the full export list of a real-shape file. Callers had to follow up with search_content to find "where is function AppInner defined" before picking a useful range.

This PR embeds a top-level export outline between the head slice and the omitted-marker — function / class / const / interface / type / enum names with their line numbers — so the caller can pick a range without a follow-up grep.

  • Cap: 30 entries (first 25 + last 5 + an elide marker like [… N more exports between Lx and Ly …]).
  • Skipped when the file has zero matching exports, so .txt / .md / .json aren't polluted with empty outlines.
  • TS-leaning regex (^export ...); language-aware parsing is intentionally out of scope.

Closes #487

Test plan

  • tests/filesystem-tools.test.ts — three new cases: outline present + line numbers correct, outline absent for export-less files, outline elision when > 30 exports.
  • npm run verify (full suite, 2294 tests).

When the auto-preview path fires (file > 200 lines, no head/tail/range
given), the head 80 + tail 40 slice rarely covers the full export list
of a real file. Callers had to follow up with a search_content grep to
locate "where is function AppInner defined" before they could pick a
useful range.

Now the auto-preview embeds a top-level outline between the head slice
and the omitted-marker — function / class / const / interface / type /
enum names with their line numbers, capped at 30 entries (first 25 +
last 5 + an elide marker). One round-trip, not three.

Closes #487
@esengine esengine merged commit ec5bfab into main May 9, 2026
3 checks passed
@esengine esengine deleted the feat/487-read-file-symbol-outline branch May 9, 2026 04:43
@esengine esengine mentioned this pull request May 9, 2026
2 tasks
ChasLui pushed a commit to ChasLui/DeepSeek-Reasonix that referenced this pull request May 23, 2026
…sengine#490)

When the auto-preview path fires (file > 200 lines, no head/tail/range
given), the head 80 + tail 40 slice rarely covers the full export list
of a real file. Callers had to follow up with a search_content grep to
locate "where is function AppInner defined" before they could pick a
useful range.

Now the auto-preview embeds a top-level outline between the head slice
and the omitted-marker — function / class / const / interface / type /
enum names with their line numbers, capped at 30 entries (first 25 +
last 5 + an elide marker). One round-trip, not three.

Closes esengine#487
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.

tools: add top-level symbol outline to read_file auto-preview

1 participant