Skip to content

LSP code cleanup#247

Merged
panglesd merged 1 commit into
mainfrom
lsp-code-cleanup
Jun 6, 2026
Merged

LSP code cleanup#247
panglesd merged 1 commit into
mainfrom
lsp-code-cleanup

Conversation

@panglesd
Copy link
Copy Markdown
Owner

@panglesd panglesd commented Jun 5, 2026

Splitting in modules, adding mlis, less invasive logging, small refactors, things like that.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Linter diff in the way? Review this PR in Change Stack to focus on meaningful changes and expand context only when needed.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a63ddc55-438c-411e-a146-e6dfdc631c4a

📥 Commits

Reviewing files that changed from the base of the PR and between 830135a and d3bc701.

📒 Files selected for processing (10)
  • src/lspishow/buffers.ml
  • src/lspishow/buffers.mli
  • src/lspishow/lspishow.ml
  • src/lspishow/read_file.ml
  • src/lspishow/read_file.mli
  • src/lspishow/rev_deps.ml
  • src/lspishow/rev_deps.mli
  • src/lspishow/roots.ml
  • src/lspishow/roots.mli
  • src/server/server.ml
💤 Files with no reviewable changes (2)
  • src/lspishow/rev_deps.ml
  • src/server/server.ml
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/lspishow/rev_deps.mli
  • src/lspishow/read_file.ml
  • src/lspishow/roots.mli
  • src/lspishow/buffers.mli
  • src/lspishow/buffers.ml
  • src/lspishow/read_file.mli

📝 Walkthrough

Walkthrough

The 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

  • panglesd/slipshow#229: The initial LSPishow implementation whose State-based buffer/root wiring this PR refactors.
  • panglesd/slipshow#242: Related preview/control handling changes that overlap with this PR’s preview navigation and control broadcasting adjustments.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "LSP code cleanup" is vague and generic, using non-descriptive language that doesn't convey meaningful information about the specific changes made. Consider a more specific title like "Refactor LSP state management into shared modules" or "Modularize buffers, roots, and file-reading logic" to better reflect the primary changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description is related to the changeset, mentioning modularization, adding interface files, logging improvements, and refactors that align with the actual changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 93bab57 and 830135a.

📒 Files selected for processing (10)
  • src/lspishow/buffers.ml
  • src/lspishow/buffers.mli
  • src/lspishow/lspishow.ml
  • src/lspishow/read_file.ml
  • src/lspishow/read_file.mli
  • src/lspishow/rev_deps.ml
  • src/lspishow/rev_deps.mli
  • src/lspishow/roots.ml
  • src/lspishow/roots.mli
  • src/server/server.ml
💤 Files with no reviewable changes (2)
  • src/server/server.ml
  • src/lspishow/rev_deps.ml

Comment thread src/lspishow/lspishow.ml Outdated
@panglesd panglesd force-pushed the lsp-code-cleanup branch from 830135a to d3bc701 Compare June 6, 2026 09:03
@panglesd panglesd merged commit e76edb6 into main Jun 6, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant