tools: add top-level export outline to read_file auto-preview#490
Merged
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
read_fileauto-preview fires (file > 200 lines, nohead/tail/rangegiven), the head 80 + tail 40 slice doesn't cover the full export list of a real-shape file. Callers had to follow up withsearch_contentto find "where isfunction AppInnerdefined" before picking a usefulrange.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.
[… N more exports between Lx and Ly …])..txt/.md/.jsonaren't polluted with empty outlines.^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).