crates/lsp/src is fully audited (all 5 files, no MEDIUM/LOW remaining): #517

Merged
navicore merged 1 commit from refactor-lsp into main 2026-05-25 01:12:51 +00:00
Owner

crates/lsp/src is fully audited (all 5 files, no MEDIUM/LOW remaining):

diagnostics.rs, main.rs, completion.rs, includes.rs, words.rs — each
refactored with focused helper extractions, every step verified green
(clippy clean, 46 seq-lsp tests passing throughout). The checklist at
tmp/rust-audit-crates-lsp-src.md has it all, including the deferred
cross-file notes (the code_actions.rs split, the main.rs helpers module,
and a shared signature_or_unknown helper).

Three audit checklists now sit in tmp/ for whenever you pick back up —
compiler (MEDIUM/LOW + tests remaining), core (2 LOW remaining), and lsp
(complete). Cheers!

crates/lsp/src is fully audited (all 5 files, no MEDIUM/LOW remaining): diagnostics.rs, main.rs, completion.rs, includes.rs, words.rs — each refactored with focused helper extractions, every step verified green (clippy clean, 46 seq-lsp tests passing throughout). The checklist at tmp/rust-audit-crates-lsp-src.md has it all, including the deferred cross-file notes (the code_actions.rs split, the main.rs helpers module, and a shared signature_or_unknown helper). Three audit checklists now sit in tmp/ for whenever you pick back up — compiler (MEDIUM/LOW + tests remaining), core (2 LOW remaining), and lsp (complete). Cheers!
crates/lsp/src is fully audited (all 5 files, no MEDIUM/LOW remaining):
All checks were successful
CI - Linux / CI - Linux x86_64 (pull_request) Successful in 4m7s
a3458ce1aa
diagnostics.rs, main.rs, completion.rs, includes.rs, words.rs — each
  refactored with focused helper extractions, every step verified green
  (clippy clean, 46 seq-lsp tests passing throughout). The checklist at
  tmp/rust-audit-crates-lsp-src.md has it all, including the deferred
  cross-file notes (the code_actions.rs split, the main.rs helpers module,
  and a shared signature_or_unknown helper).

  Three audit checklists now sit in tmp/ for whenever you pick back up —
  compiler (MEDIUM/LOW + tests remaining), core (2 LOW remaining), and lsp
  (complete). Cheers!
Author
Owner

Review — approve, no blockers

Pure helper-extraction refactor across the 5 crates/lsp/src files (+204/−228, net −24). Reviewed each diff; all behavior-preserving, format strings and fallbacks carried over verbatim.

  • diagnostics.rs — two boilerplate collapses: make_diagnostic(range, severity, code, source, message) (4 call sites, all had identical code_description/related_information/tags/data: None) and quickfix_action(title, edit, is_preferred) (3 sites; is_preferred correctly threaded as Some(true)/Some(false)/None). Bonus cleanup: lint_to_code_action shed its unused _source param.
  • main.rsmake_range(start_line, start_char, end_line, end_char) generalizes the old make_definition_range, which now delegates to it and keeps the chars().count() + 2 UTF-8 handling. markdown_hover(value) collapses 3 identical Hover { Markup, range: None } literals; the inline use was hoisted. Hover/symbol ranges unchanged.
  • words.rsbuiltin_word_info / stdlib_word_info extracted from the two collect_* closures. Signature formatting (format_effect, "( ? )" fallback) and doc handling (builtin: filter-non-empty; stdlib: None) preserved; sort_by on the stdlib group intact.
  • completion.rsmarkdown_doc(value) collapses 5 Documentation::MarkupContent literals. All format strings preserved.
  • includes.rsparse_module(content, what) -> Option<Program> consolidates the two parse-or-debug!-and-return blocks. Log messages identical ("stdlib {name}", canonical.display()).

The deferred cross-file notes in the description (code_actions.rs split, a main.rs helpers module, and a shared signature_or_unknown helper) are correctly left out of scope. The "( ? )" fallback now appears in three spots (builtin_word_info, stdlib_word_info, lookup_word_hover) — that's the natural seam for the future signature_or_unknown extraction.

Note on process: reviewed by diff inspection against main; did not re-run just ci locally on this branch. LSP changes don't affect compiled-program behavior, and these are provably behavior-preserving; the PR's clippy-clean + 46 seq-lsp passing claim is consistent.

## Review — approve, no blockers Pure helper-extraction refactor across the 5 `crates/lsp/src` files (+204/−228, net −24). Reviewed each diff; all behavior-preserving, format strings and fallbacks carried over verbatim. - **`diagnostics.rs`** — two boilerplate collapses: `make_diagnostic(range, severity, code, source, message)` (4 call sites, all had identical `code_description`/`related_information`/`tags`/`data: None`) and `quickfix_action(title, edit, is_preferred)` (3 sites; `is_preferred` correctly threaded as `Some(true)`/`Some(false)`/`None`). Bonus cleanup: `lint_to_code_action` shed its unused `_source` param. - **`main.rs`** — `make_range(start_line, start_char, end_line, end_char)` generalizes the old `make_definition_range`, which now delegates to it and keeps the `chars().count() + 2` UTF-8 handling. `markdown_hover(value)` collapses 3 identical `Hover { Markup, range: None }` literals; the inline `use` was hoisted. Hover/symbol ranges unchanged. - **`words.rs`** — `builtin_word_info` / `stdlib_word_info` extracted from the two `collect_*` closures. Signature formatting (`format_effect`, `"( ? )"` fallback) and doc handling (builtin: filter-non-empty; stdlib: `None`) preserved; `sort_by` on the stdlib group intact. - **`completion.rs`** — `markdown_doc(value)` collapses 5 `Documentation::MarkupContent` literals. All format strings preserved. - **`includes.rs`** — `parse_module(content, what) -> Option<Program>` consolidates the two parse-or-`debug!`-and-return blocks. Log messages identical (`"stdlib {name}"`, `canonical.display()`). The deferred cross-file notes in the description (`code_actions.rs` split, a `main.rs` helpers module, and a shared `signature_or_unknown` helper) are correctly left out of scope. The `"( ? )"` fallback now appears in three spots (`builtin_word_info`, `stdlib_word_info`, `lookup_word_hover`) — that's the natural seam for the future `signature_or_unknown` extraction. Note on process: reviewed by diff inspection against `main`; did not re-run `just ci` locally on this branch. LSP changes don't affect compiled-program behavior, and these are provably behavior-preserving; the PR's clippy-clean + 46 seq-lsp passing claim is consistent.
navicore deleted branch refactor-lsp 2026-05-25 01:12:51 +00:00
Sign in to join this conversation.
No description provided.