LSP: validate unsaved buffers (overlay model, debounced, document-local fast path)

Aperta
#382 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, rust

Direzione di ricerca

Start with the syscribe lsp implementation and the existing in-memory candidate validation used by the rename path; inspect LSP document sync, diagnostics, and related tests. Add test coverage for unsaved edits, dependent diagnostics, closing without saving, and the latency target. Done means the acceptance cases pass, validation can be disabled with syscribe.validateOnType, and disk content remains unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Part of #380.

Current state

The server validates saved content, not unsaved buffers: didChange never triggers a reload or diagnostics (syscribe help lsp). A new user edits a requirement, sees no feedback, saves, and then sees a screenful of findings.

Proposal

  1. Overlay buffers. Keep the text of open documents (didOpen/didChange, full or incremental sync) in an in-memory overlay on top of the disk model; the rename path already validates a candidate in memory, so the overlay machinery partly exists.
  2. Debounced validation. After a short idle (default 300 ms, configurable), re-parse only the changed document, re-validate the model from the overlay, and publish diagnostics. Publish for the changed document immediately and for dependents (documents that reference it) in a second pass, and clear them when the buffer is closed or reverted.
  3. Fast path. Findings that depend only on the document itself (frontmatter YAML, E002, field schema, id pattern, missing required fields) are published within the keystroke budget; whole-model findings follow.
  4. Disk wins on save. didSave and watched-file events reload as today; the overlay is dropped for a closed document.
  5. Setting syscribe.validateOnType (initialization option) so it can be turned off for very large models.

Acceptance (tests first)

  • A broken id typed into a buffer produces a diagnostic without saving, and disappears when corrected.
  • A change in one requirement updates the findings that concern its children (dependent pass).
  • Closing the buffer without saving restores the disk diagnostics; the file on disk is never modified.
  • Typing latency: the document-local pass stays under 100 ms on a 10,000-element model.

Part of #272. Scope: syscribe lsp only (standard LSP, ADR-SYS-LSP-001).


Generated by Claude Code

Lingua principale
Rust
Stelle
8
Fork
1
Merge medio
3h 35m
PR unite (30g)
69

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sjames/syscribe

Tutte le issue di sjames/syscribe

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.