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

Abierto
#382 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Rust
Estrellas
8
Forks
1
Merge medio
3 h 35 min
PR fusionados (30 d)
69

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sjames/syscribe

Todos los issues de sjames/syscribe

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.