Skip to content

refactoring: IDE stack debt — ide-db transitively links the WASM backend; &mut self query model; API warts #256

Description

@0xGeorgii

Follow-up from the comprehensive review of PR #239 (LSP server). Line numbers reference the PR branch at review time.

Severity: minor — architectural debt in the IDE stack, fine for v1 but worth tracking.

  1. The IDE/LSP stack transitively links the WASM/Rocq backend (ide/ide-db/Cargo.toml): ide-db depends on the full inference orchestration crate to reach the shared project front end, which also pulls inference-wasm-codegen, inference-wasm-to-v-translator, inference-wasm-linker and inf-wasmparser into a stack that only parses and type-checks. Build-time and binary-size cost for every LSP build; rust-analyzer deliberately keeps its front end a leaf. Direction: extract the project front end (project.rs walk + FileLoader seam) into a leaf crate (e.g. core/project-model) that both inference and ide-db depend on.
  2. Memoized queries read through &mut self (ide/ide/src/lib.rs:91): Analysis { db: &'a mut RootDatabase } because analyses are computed-and-memoized on read. Fine for the single-threaded loop, but it forecloses request cancellation and parallel reads without a RootDatabase rewrite, and only the single-threading is documented — not this constraint. This is the on-ramp for Adopt Salsa #157 (Adopt Salsa); until then, document the constraint on RootDatabase.
  3. ResilientProjectParse exposes a public warnings field documented "Always empty" (core/inference/src/project.rs:177) — an API wart; drop it or populate it.
  4. serde_json declared per-crate instead of via [workspace.dependencies] (apps/lsp/Cargo.toml:17) — third un-inherited spec in the workspace.
  5. ide/ide/src/syntax.rs duplicates ide-db's private children_of descent — expose it from ide-db instead (noted at ship time, never filed).
  6. Trivial: duplicated 5-line comment block in load_project_resilient (core/inference/src/project.rs:306-315).

Metadata

Metadata

Assignees

No one assigned

    Labels

    lspLanguage Server ProtocolrefactoringProject supplements

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions