Repository navigation
chore(lsp): remove dead code, repair slop strings, honor settings honestly - #140
Conversation
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.
|
Warning Review limit reachedNext included review available in 14 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (9)
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.
ℹ️ No blocking issues — two doc-accuracy nits inline.
Reviewed changes
- Dead-code removal in
ry-lsp: theFolderRootalias,State::workspace_contextsplus its discovery-path sort, theworkspace_context_for_path/folder_config_for_pathhelpers, and theServerCounters::filter_compile_countaccessor. Verified zero remaining references worktree-wide; the internalState::filter_compile_countcounter legitimately stays (the publish-window assertion still consumes it). The sort removal is safe — the discoverycontextsvec is matched to folder contexts by root-pathfind(backend.rs:1983), not by index. enable: falsewiring:eligibility_for_pathnow skips folders whose (or the global fallback's) settings setenable: 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 newenable_false_skips_diagnostics_for_the_foldertest 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
FolderSettingsfields removed. Wire-compatible — the VS Code extension sends the full settings object (including those keys) viainitializationOptionsand pull responses, andFolderSettingsuses#[serde(default)]withoutdeny_unknown_fields, so unknown keys are ignored. Zed passesinitialization_optionsthrough 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
selectdoc claim againstbegin_selection/compute_folder_filter), two corrupted log strings repaired, one-tupleVec<(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).
openai-compatible/glm-5.3 | 𝕏
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.
There was a problem hiding this comment.
✅ 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/inlayHintoneligibility_for_path(backend.rs:1270-1275): a folder set toenable: false— or a discovery-excluded file — now getsOk(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_folderand extracted the sharedspawn_disabled_sessionhelper. 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 thataddExecutableToTerminalPathandcheckTestFixturesare read and forwarded but nothing applies them yet. - Reworded the
enablefield doc and CHANGELOG entry to the precise gate: "publishes no diagnostics and returns no inlay hints". Leavingcode_actionungated 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).
openai-compatible/glm-5.3 | 𝕏
There was a problem hiding this comment.
✅ 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 acrossry-checker,ry-cli,ecosystem, docs, and the Zed extension). None of them touchcrates/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.
openai-compatible/glm-5.3 | 𝕏
There was a problem hiding this comment.
✅ 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'sry-checkermetamorphic pipe-placeholder tests and #138's CI workflow rework). Neither touchescrates/ry-lsporCHANGELOG.md:git diff 47dc5ae..ad78fa9 -- CHANGELOG.md crates/ry-lspis 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).
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using openai-compatible/glm-5.3 | 𝕏

Summary
Cleans dead code and review-process residue out of
crates/ry-lsp, and makes the settings model honest: the server now honorsenableand no longer models five settings it never read.Changes
FolderRoottype alias,workspace_context_for_path,folder_config_for_path, theServerCounters::filter_compile_countaccessor, and theState::workspace_contextsfield plus its sort that those functions orphaned. Nothing in the workspace called any of them.Vec<(ProjectCheckResult,)>becameVec<ProjectCheckResult>; the push and destructuring sites followed.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 theworkspace_folderssort now names its real consumer (eligibility_for_path's legacy fallback) instead of the deletedfolder_config_for_path. The hints.rs comment states the real reason for the arm shape instead of keeping clippy quiet.enableis wired througheligibility_for_path, so a folder set toenable: falseis 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 fromFolderSettings. Decision: the VS Code extension resolvespath/importStrategy/addExecutableToTerminalPath/logLevelitself (seeeditors/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. Theselectdoc no longer claims the field is unwired;compute_folder_filterconsumes it.#![allow(clippy::collapsible_if)]after collapsing the one remaining collapsible if inscope_for.editing_utils_updates_cross_file_analysis_diagnosticstoedited_return_type_updates_dependent_diagnostics.enable: falsenow disables the folder). Dead-code removal gets no entry.Verification
cargo fmt -p ry-lsp --checkcargo clippy -p ry-lsp --all-targets -- -D warningscargo test -p ry-lsp— all suites green, including the newenable_false_skips_diagnostics_for_the_folder(confirmed it fails with the wiring removed)cargo check --workspace --all-targets