lsp
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.
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.
Parent
Inbound
- call cli::LspHost · runStdio
- call context::Pseudoscript · onChange
Outbound
- call → lsp::Server · runStdio
- call → lsp::Server · onChange
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.
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.
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
- for lsp::Lsp
Outbound
- call → lsp::Store · discover
- call → lsp::Store · change
- call → lsp::Store · close
- call → lsp::Store · diagnostics
- call → lsp::Store · uriOf
- call → lsp::Store · source
- call → lsp::Store · fqnFor
- call → lsp::Store · workspace
- call → lsp_core::LspCore · hover
- call → lsp::Store · source
- call → lsp::Store · fqnFor
- call → lsp::Store · workspace
- call → lsp_core::LspCore · definition
- call → lsp::Store · source
- call → lsp_core::LspCore · formatEdit
- call → lsp::Store · uriOf
- call → lsp::Store · source
- from → lsp_core::Range
Scenarios
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
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
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
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
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
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
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
- for lsp::Lsp
Inbound
- call lsp::Server · discover
- call lsp::Server · change
- call lsp::Server · close
- call lsp::Server · diagnostics
- call lsp::Server · uriOf
- call lsp::Server · source
- call lsp::Server · fqnFor
- call lsp::Server · workspace
- call lsp::Server · source
- call lsp::Server · fqnFor
- call lsp::Server · workspace
- call lsp::Server · source
- call lsp::Server · uriOf
- call lsp::Server · source
Outbound
- from → model::ModuleDiagnostics
- from → lsp::string
- from → lsp::string
- from → lsp::string
- from → lsp::string
- from → lsp::string
- from → lsp::string
- from → lsp::string
- from → lsp::string
- from → lsp::bool
- from → model::WorkspaceModule
- from → model::Workspace