Preserve selected source bodies in codegraph output#652
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cf3a56186
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!outline) { | ||
| code = await cg.getCode(node.id); | ||
| } | ||
| code = await cg.getCode(node.id); |
There was a problem hiding this comment.
Trim large container bodies before formatting
When includeCode is used for a large class/interface/etc. (common now that containers no longer use the member outline), this fetches the entire body and handleNode then applies truncateOutput to the already-formatted section. For container bodies over ~15 KB, the result only contains the prefix of the class and can cut off later methods, the closing fence, and the trail, so users still cannot see the selected symbol body reliably. Consider applying the same middle/tail-preserving trim to the code body before formatNodeDetails (or otherwise bounding it) instead of relying on whole-output truncation.
Useful? React with 👍 / 👎.
Summary
codegraph_node includeCode=truefor container symbols instead of replacing classes/interfaces with member outlinesTesting
npx vitest run __tests__/context.test.ts __tests__/symbol-lookup.test.tsnpm run buildgit diff --check