docs(language-server): spec for lazy document state + pull diagnostics#887
Draft
SevInf wants to merge 15 commits into
Draft
docs(language-server): spec for lazy document state + pull diagnostics#887SevInf wants to merge 15 commits into
SevInf wants to merge 15 commits into
Conversation
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Make red tokens navigable (parent, prev/next token) and add SyntaxNode.tokenAtOffset (none/single/between with left/right bias), coveringElement, first/lastToken, plus trivia-skip helpers (skipTriviaToken, nonTriviaSibling, previousNonTriviaToken). Mirrors rust-analyzer syntax idioms; no fake-identifier marker. Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
…navigation Anchor classification on tokenAtOffset(offset).leftBiased() and navigate from token.parent, with one source_range()-style replacement helper. Removes findCursorContext, findTokenContext, findDeepestNodeAtOffset, tokensBetween, lineStartOffsetFromTokens, containsOnlyWhitespaceTokens, the duplicated prefix builders, and the unused UnsupportedPslCompletionReason. Behavior unchanged; matches rust-analyzer classifier shape. Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
…layground URL parsing Address PR review: rebuild completion artifacts from the current buffer before classifying so completions after an edit are not stale; parse playground request URLs against a fixed local base and return 400 on malformed/absent URLs instead of trusting the incoming Host header. Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
…d review dispatch Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
…code comments Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
… AST Replace the splitQualifiedPrefix source scan (which re-tokenized the qualified name by counting : and . in raw text) with QualifiedNameAst navigation: contract-space/namespace/name roles are resolved from colon()/dot() offsets and segment IdentifierAst offsets relative to the cursor. The only source touch left is slicing the cursor segments own identifier-token text. Deletes splitQualifiedPrefix, pathFromSegments, and segmentAt; behavior preserved, two new tests pin the colon-without-dot and cursor-mid-name cases. Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Order the Position/Range/SemanticTokens type imports merged during the rebase against main (semantic tokens + completion landed in parallel). Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
The namespace-qualifier candidate now inserts the bare namespace name (e.g. `auth`) instead of `auth.`; label/insertText/filterText all use the bare name. Member completion still works once the user types the dot. Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specification-only PR for the
lsp-document-stateproject. No implementation here — this commits the Drive project artifacts (spec, plan, slice spec) so the design can be reviewed before any code lands.What this is
A settled design for reworking the language server's document-state lifecycle from eager, defensive reparse to invalidate-on-change + lazily materialize-on-read, synchronously, plus a move from push to pull diagnostics.
Why
publish+currentDocumentArtifactper-request reparse with a whole-document text compare) to dodge a stale-buffer race the LSP spec says we should not have to fight.prisma-next.config.ts, evaluated via dynamic import); parse/derive stays synchronous so a derived result is always internally consistent for one version.Scope
lazy-state-and-pull-diagnostics(lazy lifecycle + pull diagnostics ship together — dropping eager compute requires the pull transport to exist).TextDocumentsis kept (demoted to text mirror / lifecycle / version source).{ interFileDependencies: false, workspaceDiagnostics: false }with an honest scope-comment; the multi-input table flip is deferred.Non-goals
Removing
TextDocuments, the multi-input symbol table, multi-project membership, and any behavioural changes to completion/semantic-tokens/folding. Seeprojects/lsp-document-state/spec.md§ Non-goals.Sequencing
Stacked on
lsp-autocomplete(#871); base islsp-autocomplete, notmain. Merges after #871.Artifacts
projects/lsp-document-state/spec.mdprojects/lsp-document-state/plan.mdprojects/lsp-document-state/slices/lazy-state-and-pull-diagnostics/spec.md