PseudoScript
Module

lsp

data

DefTarget #

private
lsp::DefTarget

A go-to-definition target straight from `lsp_core`: the FQN of the module the definition lives in, and its span within that module's source. The server maps `fqn` to a file URI — the target file, not the file the request came from.

Entities Entity diagram scroll to zoom · drag to pan
RECORDDefTargetfqnstringspansyntax::SpanRECORDSpanstartnumberendnumber
container

Lsp #

public
lsp::Lsp

`crates/pseudoscript-lsp`. The stdio language server (tower-lsp): workspace diagnostics on change, and hover, definition, completion, references, rename, semantic tokens, symbols, folding, and formatting — every language answer delegated to `lsp_core`. Owns the transport, the document store, and the URI↔FQN mapping, nothing more.

Inbound

Outbound

Components Component diagram scroll to zoom · drag to pan
PseudoscriptLspCOMPONENTServerThe tower-lsp `Backend`: owns the stdiotransport, the document store, the server…COMPONENTStoreThe workspace document store: the server'sown filesystem edge. Discovers the project…CONTAINERCli`crates/pseudoscript` — the binary crate(`pds`). The composition root and only I/O…CONTAINERLspCore`crates/pseudoscript-lsp-core`. The singlehome for language intelligence as…CONTAINERModel`crates/pseudoscript-model`. AST to oneresolved graph; static checks (resolution,…checkcheckWorkspacecheckWorkspaceModulesgraphchangeclosediagnosticsdiscoverfqnForsourceuriOfworkspacedefinitionformatEdithovercheck
data

Occurrence #

private
lsp::Occurrence

One resolved editor location: the file URI a target FQN maps back to, and the range within it. The server's transport-level mapping of a `lsp_core` answer.

Entities Entity diagram scroll to zoom · drag to pan
RECORDOccurrenceuristringrangelsp_core::RangeRECORDRangestartlsp_core::Positionendlsp_core::Position
data

OpenDocument #

private
lsp::OpenDocument

One open editor buffer: its document URI, current source text, and the editor's version counter. The buffer overlays on-disk text until closed.

Entities Entity diagram scroll to zoom · drag to pan
RECORDOpenDocumenturistringtextstringversionnumber
component

Server #

private
lsp::Server

The tower-lsp `Backend`: owns the stdio transport, the document store, the server lifecycle, and request routing. Holds no language logic — it locks the store, hands the active text and the resolved workspace to a `lsp_core` handler, and maps the result back to file locations.

Parent

Inbound

Outbound

Scenarios

SpawnedOverStdio

The editor spawns `pds lsp` as a child process and drives it over stdio.

  • given an editor that speaks the Language Server Protocol
  • when it needs language support for a .pds document
  • then it spawns `pds lsp` as a child process
  • and the server reads requests and writes responses over stdin and stdout
Flow Flow — SpawnedOverStdio scroll to zoom · drag to pan
FEATURESpawnedOverStdiofor ServerGIVENan editor that speaks the LanguageServer ProtocolWHENit needs language support for a .pdsdocumentTHENit spawns `pds lsp` as a child processANDthe server reads requests and writesresponses over stdin and stdout
RepublishOnChange

Every change re-checks and republishes diagnostics for the whole workspace.

  • given a document open in the editor
  • when the editor sends didOpen, didChange, or didClose
  • then the store re-converges from the document's current text
  • and every module's diagnostics are published against its own file
  • but a cross-file issue surfaces in the file that causes it
Flow Flow — RepublishOnChange scroll to zoom · drag to pan
FEATURERepublishOnChangefor ServerGIVENa document open in the editorWHENthe editor sends didOpen, didChange,or didCloseTHENthe store re-converges from thedocument's current textANDevery module's diagnostics arepublished against its own fileBUTa cross-file issue surfaces in thefile that causes it
FullDocumentSync

Full document sync: each change carries the entire new text.

  • given the server advertised full text-document sync
  • when the editor sends a didChange notification
  • then the last content change carries the whole new document text
  • and the store replaces the buffer wholesale rather than patching a range
Flow Flow — FullDocumentSync scroll to zoom · drag to pan
FEATUREFullDocumentSyncfor ServerGIVENthe server advertised fulltext-document syncWHENthe editor sends a didChangenotificationTHENthe last content change carries thewhole new document textANDthe store replaces the bufferwholesale rather than patching a range
AnswerFromCurrentText

All requests are answered from the document's current source.

  • given a document with unsaved edits open in the editor
  • when the editor requests hover, definition, completion, or formatting
  • then the active buffer's current text is handed to lsp_core
  • but the on-disk version is not consulted while a buffer is open
Flow Flow — AnswerFromCurrentText scroll to zoom · drag to pan
FEATUREAnswerFromCurrentTextfor ServerGIVENa document with unsaved edits open inthe editorWHENthe editor requests hover, definition,completion, or formattingTHENthe active buffer's current text ishanded to lsp_coreBUTthe on-disk version is not consultedwhile a buffer is open
DelegatesAllLanguageLogic

The server owns no language logic — it delegates to lsp_core.

  • given a request that needs parsing, checking, resolution, or formatting
  • when the server handles it
  • then every language answer is computed by the lsp_core handlers
  • and checking delegates to the model crate
  • but the server adds no language rules of its own — only transport, the disk walk, and URI mapping
Flow Flow — DelegatesAllLanguageLogic scroll to zoom · drag to pan
FEATUREDelegatesAllLanguageLogicfor ServerGIVENa request that needs parsing,checking, resolution, or formattingWHENthe server handles itTHENevery language answer is computed bythe lsp_core handlersANDchecking delegates to the model crateBUTthe server adds no language rules ofits own — only transport, the diskwalk, and URI mapping
DefinitionJumpsToDeclaration

Go-to-definition jumps to the declaring span, across files.

  • given the cursor on a reference to a node, member, or data type
  • when the editor requests go-to-definition
  • then lsp_core resolves the reference to its declaring module FQN and span
  • and the server maps that FQN back to its file URI, even in another module
Flow Flow — DefinitionJumpsToDeclaration scroll to zoom · drag to pan
FEATUREDefinitionJumpsToDeclarationfor ServerGIVENthe cursor on a reference to a node,member, or data typeWHENthe editor requests go-to-definitionTHENlsp_core resolves the reference to itsdeclaring module FQN and spanANDthe server maps that FQN back to itsfile URI, even in another module
component

Store #

private
lsp::Store

The workspace document store: the server's own filesystem edge. Discovers the project root (`pds.toml`, §8.1) by walking up from the opened URI, walks the tree for every visible `.pds` file, derives each module's FQN from its path, and overlays open buffers on disk text. Caches each parse and memoises the resolved `model::Workspace` — built from the local parses with the workspace's direct-dependency externals bound (§8.3) — both invalidated on any edit. The externals are cached separately and reload only on a dependency change.

Parent

Inbound

Outbound

Generated by pds doc.