LSP code cleanup#247
Conversation
|
Linter diff in the way? Review this PR in Change Stack to focus on meaningful changes and expand context only when needed. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughThe PR replaces a monolithic State with Read_file (file-reader primitives), Buffers (in-memory source+parsed-unit cache), Roots (per-root compiled units, diagnostics, Lwt_condition, versioning), and a simplified Rev_deps API. lspishow is rewired to use these modules (buffer updates under a shared mutex, filesystem reads via Read_file.fs), and preview/polling logging is cleaned up. Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lspishow/lspishow.ml`:
- Around line 263-267: The current code skips calling State.update_from_buffer
when Config.Refresh.when_() is Save or Never, which leaves
Roots.buffers/Buffers.buffers stale and breaks
diagnostics/hover/completion/definition; to fix, ensure the buffer state is
updated regardless of refresh mode by moving or invoking
State.update_from_buffer file contents unconditionally (or at least before any
handlers that read Roots.buffers/Buffers.buffers), keep the existing match for
any extra edit-specific behavior but do not rely on it to populate buffer
stores, and update any references in handlers that assume buffers are already
current (diagnostics, hover, completion, definition) to run after this
unconditional update.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5270e90d-e06b-4767-977c-4a591e9e3b56
📒 Files selected for processing (10)
src/lspishow/buffers.mlsrc/lspishow/buffers.mlisrc/lspishow/lspishow.mlsrc/lspishow/read_file.mlsrc/lspishow/read_file.mlisrc/lspishow/rev_deps.mlsrc/lspishow/rev_deps.mlisrc/lspishow/roots.mlsrc/lspishow/roots.mlisrc/server/server.ml
💤 Files with no reviewable changes (2)
- src/server/server.ml
- src/lspishow/rev_deps.ml
830135a to
d3bc701
Compare
Splitting in modules, adding mlis, less invasive logging, small refactors, things like that.