Refactor analysis CLI helpers to use source input#8466
Conversation
Move document symbols and interface generation behind CLI helpers that operate on source content instead of reading files internally. Thread parsed max inlay hint length as an option, pass preloaded CMT data into code actions. Update the DocTemplate expected output for the new CMT lookup message emitted during non-compiled code action tests.
5bf9e43 to
21f2294
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21f2294231
ℹ️ 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".
| Xform.extract_code_actions ~state ~path ~start_pos ~end_pos ~source | ||
| ~kind_file ~debug | ||
| ~kind_file | ||
| ~full:(Cmt.load_full_cmt_from_path ~state ~path) |
There was a problem hiding this comment.
Avoid loading CMTs for interface-only code actions
When current_file is a .resi, Xform.extract_code_actions never uses full, but this eager call still tries to resolve a CMT for path before dispatching. In uncompiled/interface-only cases this now emits can't find module ... (as shown by the updated DocTemplate fixture) and does unnecessary package/CMT lookup for doc-template actions that work purely from source; compute full only for implementation actions that need type information.
Useful? React with 👍 / 👎.
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8466 +/- ##
==========================================
- Coverage 60.91% 60.91% -0.01%
==========================================
Files 374 374
Lines 54099 54100 +1
==========================================
Hits 32955 32955
- Misses 21144 21145 +1
🚀 New features to boost your workflow:
|
Refactor analysis CLI helpers to use source input
Move document symbols and interface generation behind CLI helpers that operate on source content instead of reading files internally. Thread parsed max inlay hint length as an option, pass preloaded CMT data into code actions.
Update the DocTemplate expected output for the new CMT lookup message emitted during non-compiled code action tests.
Some cases that are not done in #8426
Cherry-pick of #8425