Refactor server backend structure#35
Conversation
|
| Filename | Overview |
|---|---|
| crates/analysis/src/actions.rs | Moves reference-copy quick-fix generation into analysis and adds a source loader; found a kind-matching bug when extracting the source block. |
| crates/server/src/asset_index.rs | Extracts asset discovery, BIG/W3D parsing, persistent cache handling, and scan tests into a dedicated module. |
| crates/server/src/backend.rs | Refactors the LSP backend to delegate document state and asset indexing while preserving protocol-facing behavior. |
| crates/server/src/document.rs | Introduces DocumentStore for synchronized live document snapshots, diagnostic caches, semantic history, virtual files, and source precedence. |
| crates/analysis/tests/spec.rs | Updates action test helper calls to pass the new source-loader callback. |
| crates/server/src/main.rs | Registers the new asset_index and document modules. |
Reviews (1): Last reviewed commit: "refactor: move origin copy fixes to anal..." | Re-trigger Greptile
| .find(|node| { | ||
| Block(node.clone()) | ||
| .name() | ||
| .is_some_and(|token| token.text().eq_ignore_ascii_case(&name)) |
There was a problem hiding this comment.
Match definition kind
The reference-copy fix finds the base location using kind, but then copies the first parsed block with the same name without checking the block keyword. When one INI contains two definition kinds with the same name, the action can insert the wrong reference copy for the overrides diagnostic.
f50615b to
f911605
Compare
Depends on #33; merge #33 first.
What changed
asset_index.DocumentStore.Why
backend.rshad accumulated asset ingestion, mutable document invariants, and analysis-specific quick-fix logic alongside LSP protocol handling. These deeper modules give each concern one concrete owner while keeping protocol adaptation together.Compatibility
No schema, cache version/shape/path, LSP command, editor setting, or user-visible behavior changes are intended. Existing cache files remain compatible, scan ordering and invalidation are preserved, and cache clear/rebuild commands remain advertised.
After #33 merges, retarget this PR to
dev.Validation
cargo testcargo clippy --workspace --all-targets -- -D warningsnpm run compileineditors/vscodecargo fmt --all -- --checkstill reports a pre-existing formatting difference in untouchedcrates/analysis/src/completion.rs.