Skip to content

chore(lsp): remove dead code, repair slop strings, honor settings honestly - #140

Merged
sims1253 merged 5 commits into
mainfrom
cleanup/lsp-dead-code-slop
Aug 31, 2026
Merged

sims1253 merged 5 commits into
mainfrom
cleanup/lsp-dead-code-slop

Conversation

@sims1253

Copy link
Copy Markdown
Owner

Summary

Cleans dead code and review-process residue out of crates/ry-lsp, and makes the settings model honest: the server now honors enable and no longer models five settings it never read.

Changes

  • Deleted dead code: the FolderRoot type alias, workspace_context_for_path, folder_config_for_path, the ServerCounters::filter_compile_count accessor, and the State::workspace_contexts field plus its sort that those functions orphaned. Nothing in the workspace called any of them.
  • Vec<(ProjectCheckResult,)> became Vec<ProjectCheckResult>; the push and destructuring sites followed.
  • Repaired two log strings corrupted by broken line continuations (the didChange batch abort and the discovery-cap warning). Same information, readable text.
  • Stripped PR-review and stage-tag bookkeeping from comments (PR #79 round 3, PR #69 review, S2/S4/E1/E2, #44/#54/#56, and kin). The invariants stay; the ledger tags go. The comment near the workspace_folders sort now names its real consumer (eligibility_for_path's legacy fallback) instead of the deleted folder_config_for_path. The hints.rs comment states the real reason for the arm shape instead of keeping clippy quiet.
  • Settings: enable is wired through eligibility_for_path, so a folder set to enable: false is skipped — no analysis, an empty diagnostics publish for its open documents, and its disk files drop out of the publish set. The five fields the server never reads (check_test_fixtures, log_level, path, import_strategy, add_executable_to_terminal_path) are removed from FolderSettings. Decision: the VS Code extension resolves path/importStrategy/addExecutableToTerminalPath/logLevel itself (see editors/code/src/common/settings.ts), Zed passes arbitrary keys through, and the server ignores unknown keys — so keeping the fields only pretended to honor them. The select doc no longer claims the field is unwired; compute_folder_filter consumes it.
  • Removed the crate-level #![allow(clippy::collapsible_if)] after collapsing the one remaining collapsible if in scope_for.
  • Renamed editing_utils_updates_cross_file_analysis_diagnostics to edited_return_type_updates_dependent_diagnostics.
  • CHANGELOG: one Changed entry for the settings change (user-visible: enable: false now disables the folder). Dead-code removal gets no entry.

Verification

  • cargo fmt -p ry-lsp --check
  • cargo clippy -p ry-lsp --all-targets -- -D warnings
  • cargo test -p ry-lsp — all suites green, including the new enable_false_skips_diagnostics_for_the_folder (confirmed it fails with the wiring removed)
  • cargo check --workspace --all-targets

Delete dead code: the FolderRoot alias, workspace_context_for_path,
folder_config_for_path, the ServerCounters::filter_compile_count
accessor, and the workspace_contexts field those functions orphaned.
Untangle Vec<(ProjectCheckResult,)> into Vec<ProjectCheckResult>.
Repair two log strings corrupted by broken line continuations.
Drop PR-review and stage-tag bookkeeping from comments; the invariants
they annotated stay. Replace the clippy-quiet comment in hints.rs with
the real reason for the arm shape. Collapse the one remaining
collapsible_if in scope_for and remove the crate-level allow.
Rename edited_return_type_updates_dependent_diagnostics (was
editing_utils_updates_cross_file_analysis_diagnostics) to say what it
checks.
Wire enable: a folder whose settings set enable: false is skipped in
eligibility_for_path, so the server analyzes nothing and publishes an
empty diagnostics set for it, on disk files as well as open documents.
Drop the five FolderSettings fields nothing on the server reads
(check_test_fixtures, log_level, path, import_strategy,
add_executable_to_terminal_path): the extensions own them, and the
server ignores unknown keys either way. Fix the select doc: the field
is consumed by compute_folder_filter and an explicit empty list
disables default-enabled rules. Add an integration test for enable.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 14 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: a9044bdc-5de2-4a92-8995-7c039f4849dd

📥 Commits

Reviewing files that changed from the base of the PR and between 5cf7a30 and ad78fa9.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • crates/ry-lsp/src/backend.rs
  • crates/ry-lsp/src/hints.rs
  • crates/ry-lsp/src/index.rs
  • crates/ry-lsp/src/lib.rs
  • crates/ry-lsp/src/settings.rs
  • crates/ry-lsp/src/tests.rs
  • crates/ry-lsp/tests/configuration_refresh.rs
  • crates/ry-lsp/tests/protocol_contract.rs

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No blocking issues — two doc-accuracy nits inline.

Reviewed changes

  • Dead-code removal in ry-lsp: the FolderRoot alias, State::workspace_contexts plus its discovery-path sort, the workspace_context_for_path/folder_config_for_path helpers, and the ServerCounters::filter_compile_count accessor. Verified zero remaining references worktree-wide; the internal State::filter_compile_count counter legitimately stays (the publish-window assertion still consumes it). The sort removal is safe — the discovery contexts vec is matched to folder contexts by root-path find (backend.rs:1983), not by index.
  • enable: false wiring: eligibility_for_path now skips folders whose (or the global fallback's) settings set enable: false; its three consumers are all in the publish path — open-doc filter (backend.rs:1647), empty publish for the requested URI (backend.rs:1658-1666), disk-file filter (backend.rs:1685). The new enable_false_skips_diagnostics_for_the_folder test pins this with the established RY090 fixture (z <- length(xx = 1L)), so the assertion can genuinely fail — real coverage, not theatre.
  • Settings model slimmed: five never-read FolderSettings fields removed. Wire-compatible — the VS Code extension sends the full settings object (including those keys) via initializationOptions and pull responses, and FolderSettings uses #[serde(default)] without deny_unknown_fields, so unknown keys are ignored. Zed passes initialization_options through verbatim (editors/zed/src/lib.rs:410-417), as the PR body claims.
  • Doc/comment cleanup: review-ledger tags stripped (invariants intact — re-verified the select doc claim against begin_selection/compute_folder_filter), two corrupted log strings repaired, one-tuple Vec<(ProjectCheckResult,)> fixed, the collapsible if collapsed with let-chains, one test renamed.

All of the PR's verification claims reproduced locally: cargo fmt -p ry-lsp --check, cargo clippy -p ry-lsp --all-targets -- -D warnings, cargo test -p ry-lsp --test configuration_refresh (3/3), cargo test -p ry-lsp --lib (50/50).

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using openai-compatible/glm-5.3 | 𝕏

Comment thread crates/ry-lsp/src/settings.rs Resolved
Comment thread crates/ry-lsp/src/settings.rs Resolved
inlay_hint now consults eligibility_for_path, so enable: false (or a
discovery exclude) also stops on-demand analysis, not just diagnostics
publishing. New test enable_false_skips_inlay_hints_for_the_folder pins
it; with the gate removed it fails on a returned integer hint.

The settings module doc no longer claims the extension resolves
addExecutableToTerminalPath and checkTestFixtures. Nothing applies those
two anywhere in editors/code; only path, importStrategy, and logLevel
are resolved there. The enable field doc and CHANGELOG entry state the
precise gate.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found. Both prior threads are addressed and resolved; the new gate's test is real coverage.

Reviewed changes

Since the last review (6581e33), one commit landed, taking the wiring option on both open threads:

  • Gated textDocument/inlayHint on eligibility_for_path (backend.rs:1270-1275): a folder set to enable: false — or a discovery-excluded file — now gets Ok(None) instead of on-demand analysis and rendered hints, making the on-demand path consistent with the publish path.
  • Added enable_false_skips_inlay_hints_for_the_folder and extracted the shared spawn_disabled_session helper. Fault-injected locally: with the gate removed the test fails on the returned : integer<len=1> hint, so the assertion can genuinely fail.
  • Rewrote the settings module doc to name only the three settings the extension actually resolves (path, importStrategy, logLevel) and state plainly that addExecutableToTerminalPath and checkTestFixtures are read and forwarded but nothing applies them yet.
  • Reworded the enable field doc and CHANGELOG entry to the precise gate: "publishes no diagnostics and returns no inlay hints". Leaving code_action ungated is sound — it runs no analysis; its quick-fixes derive from client-sent diagnostics (empty for a disabled folder) and the ignore-file action is a pure text edit.

All gates reproduced locally: cargo fmt -p ry-lsp --check, cargo clippy -p ry-lsp --all-targets -- -D warnings, cargo test -p ry-lsp (87 passed, 1 pre-existing ignore).

Pullfrog  | View workflow run | Using openai-compatible/glm-5.3 | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Merge commit verified — no change to the PR's own content, all gates green on the merged tree.

Reviewed changes

Since the previous review (29c527e), one commit landed:

  • Merged origin/main (47dc5ae, bringing in main@78fc1d5 — six commits across ry-checker, ry-cli, ecosystem, docs, and the Zed extension). None of them touch crates/ry-lsp, and the PR's net diff against main is byte-identical to the approved state (all nine per-file diff hashes unchanged), so the approval at 29c527e carries over. The CHANGELOG merged cleanly with the PR's entry intact.

Verified on the merged tree: cargo check --workspace --all-targets clean, cargo test -p ry-lsp 87/87 passed.

Pullfrog  | View workflow run | Using openai-compatible/glm-5.3 | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Merge commit verified — no change to the PR's own content, all gates green on the merged tree.

Reviewed changes

Since the previous review (47dc5ae), one commit landed:

  • Merged origin/main (ad78fa9, bringing in main@5cf7a30 — two commits: #132's ry-checker metamorphic pipe-placeholder tests and #138's CI workflow rework). Neither touches crates/ry-lsp or CHANGELOG.md: git diff 47dc5ae..ad78fa9 -- CHANGELOG.md crates/ry-lsp is empty, so the PR's net diff is byte-identical to the approved state and the approval at 47dc5ae carries over. The CHANGELOG merged cleanly with the PR's entry intact.

Verified on the merged tree: cargo check --workspace --all-targets clean, cargo test -p ry-lsp green across all targets (including both enable: false tests; 1 pre-existing nightly ignore).

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using openai-compatible/glm-5.3 | 𝕏

@sims1253
sims1253 merged commit 95a4913 into main Aug 31, 2026
16 checks passed
@sims1253
sims1253 deleted the cleanup/lsp-dead-code-slop branch August 31, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant