PseudoScript
Module

lsp_core

component

Analysis #

private
lsp_core::Analysis

Document-level analysis: parse-and-check diagnostics, Markdown hover for the symbol under the caret (falling back to an inferred type), go-to-definition, inlay hints, and the canonical format edit. Resolution is delegated to `model`; this maps the result into LSP shapes.

Parent

Inbound

Outbound

Scenarios

ResolutionDelegatedToModel

Resolution is delegated to the model, not re-implemented.

  • given a cursor feature — hover, definition, references, completion
  • when the symbol under the caret must be resolved
  • then resolution runs through model's resolver against the workspace and externals
  • and this crate only maps the resolved answer into the LSP shape
Flow Flow — ResolutionDelegatedToModel scroll to zoom · drag to pan
FEATUREResolutionDelegatedToModelfor AnalysisGIVENa cursor feature — hover, definition,references, completionWHENthe symbol under the caret must beresolvedTHENresolution runs through model'sresolver against the workspace andexternalsANDthis crate only maps the resolvedanswer into the LSP shape
HoverShowsDocSummary

Hover shows the `///` summary of the symbol under the caret.

  • given the caret resting on a declared node, data type, or member
  • when hover runs
  • then the symbol's kind and FQN, or its member signature, is shown
  • and its `///` summary is appended under the title
Flow Flow — HoverShowsDocSummary scroll to zoom · drag to pan
FEATUREHoverShowsDocSummaryfor AnalysisGIVENthe caret resting on a declared node,data type, or memberWHENhover runsTHENthe symbol's kind and FQN, or itsmember signature, is shownANDits `///` summary is appended underthe title
HoverFallsBackToInferredType

An unresolved caret on a local binding falls back to its inferred type.

  • given the caret resting on a local binding rather than a declaration
  • when hover finds no declared symbol there
  • then the binding's inferred type is shown as `name: Type`
  • but an expression that cannot be typed yields no hover
Flow Flow — HoverFallsBackToInferredType scroll to zoom · drag to pan
FEATUREHoverFallsBackToInferredTypefor AnalysisGIVENthe caret resting on a local bindingrather than a declarationWHENhover finds no declared symbol thereTHENthe binding's inferred type is shownas `name: Type`BUTan expression that cannot be typedyields no hover
ResolutionSurvivesPartialParse

Resolution survives a partial parse by working at the token level.

  • given a document that does not fully parse
  • when the caret rests on an identifier in a well-formed region
  • then resolution still tokenizes and resolves that identifier
  • but a caret on whitespace, punctuation, or an unknown name yields nothing
Flow Flow — ResolutionSurvivesPartialParse scroll to zoom · drag to pan
FEATUREResolutionSurvivesPartialParsefor AnalysisGIVENa document that does not fully parseWHENthe caret rests on an identifier in awell-formed regionTHENresolution still tokenizes andresolves that identifierBUTa caret on whitespace, punctuation, oran unknown name yields nothing
FormatOrLeaveUntouched

Whole-document format produces an edit, or nothing on a parse error.

  • given a document buffer
  • when a format edit is requested
  • then a parseable document yields one whole-document edit to canonical form
  • but an unparseable document yields no edit
Flow Flow — FormatOrLeaveUntouched scroll to zoom · drag to pan
FEATUREFormatOrLeaveUntouchedfor AnalysisGIVENa document bufferWHENa format edit is requestedTHENa parseable document yields onewhole-document edit to canonical formBUTan unparseable document yields no edit
component

Complete #

public
lsp_core::Complete

Completion: the candidates offered at a byte offset, resolved across the workspace and its externals. A `.`/`::` boundary drives member and path completion.

Parent

data

CompletionItem #

public
lsp_core::CompletionItem

One completion candidate: the inserted label, the integer LSP `CompletionItemKind`, and detail text.

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

Convert #

public
lsp_core::Convert

Position conversion: the single home for mapping between byte offsets and UTF-16 line/character positions, so every handler agrees on coordinates.

Parent

Scenarios

SpansMapToUtf16Positions

Spans map to UTF-16 positions consistently across every handler.

  • given a byte span in a document
  • when it is converted for the editor
  • then it maps to a UTF-16 line/character range
  • and every handler shares this one conversion, so coordinates always agree
Flow Flow — SpansMapToUtf16Positions scroll to zoom · drag to pan
FEATURESpansMapToUtf16Positionsfor ConvertGIVENa byte span in a documentWHENit is converted for the editorTHENit maps to a UTF-16 line/characterrangeANDevery handler shares this oneconversion, so coordinates alwaysagree
data

DefTarget #

public
lsp_core::DefTarget

A go-to-definition target: the FQN of the module the definition lives in and the byte span of the definition within that module's source. The consuming edge maps `fqn` to a file URI and converts `span` to an editor range against *that* file's text — `lsp_core` returns the byte span, not a `Range`, because it does not hold the target module's source to convert against.

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

Diagnostic #

public
lsp_core::Diagnostic

One diagnostic mapped to LSP shape: its range, severity, message, optional code, and the code's article URL (`codeDescription`, the editor's clickable link — empty when the code carries no article). Converted from the parser/checker's byte-span diagnostics; the code and its URL pass through unchanged.

Entities Entity diagram scroll to zoom · drag to pan
RECORDDiagnosticrangelsp_core::RangeseveritynumbermessagestringcodestringcodeDescriptionstringRECORDRangestartlsp_core::Positionendlsp_core::Position
data

Hover #

public
lsp_core::Hover

Markdown hover content the editor renders in a tooltip.

Entities Entity diagram scroll to zoom · drag to pan
RECORDHovercontentsstring
container

LspCore #

public
lsp_core::LspCore

`crates/pseudoscript-lsp-core`. The single home for language intelligence as transport-neutral handlers — the same logic the stdio server and the browser wasm both call.

Inbound

Outbound

Scenarios

TransportNeutralHandlers

One implementation answers from current text, transport-free.

  • given a buffer's current text and a caret position
  • when a language query runs
  • then the answer is computed as a pure text-plus-position function
  • but no transport, async runtime, or tower-lsp is involved — both edges share it
Flow Flow — TransportNeutralHandlers scroll to zoom · drag to pan
FEATURETransportNeutralHandlersfor LspCoreGIVENa buffer's current text and a caretpositionWHENa language query runsTHENthe answer is computed as a puretext-plus-position functionBUTno transport, async runtime, ortower-lsp is involved — both edgesshare it
Components Component diagram scroll to zoom · drag to pan
PseudoscriptLspCoreCOMPONENTAnalysisDocument-level analysis: parse-and-checkdiagnostics, Markdown hover for the symbol…COMPONENTCompleteCompletion: the candidates offered at a byteoffset, resolved across the workspace and…COMPONENTConvertPosition conversion: the single home formapping between byte offsets and UTF-16…COMPONENTRefsReferences and rename: every occurrence ofthe symbol under the caret across the…COMPONENTSemanticSemantic tokens: AST-aware highlighting thatcolours each token by its declared role,…COMPONENTSymbolsDocument and workspace structure: theoutline symbols, the foldable ranges, and…CONTAINERLsp`crates/pseudoscript-lsp`. The stdiolanguage server (tower-lsp): workspace…CONTAINERModel`crates/pseudoscript-model`. AST to oneresolved graph; static checks (resolution,…check
data

Position #

public
lsp_core::Position

A zero-based caret position: line and UTF-16 character offset within the line. This and the shapes below model the standalone `lsp_types` vocabulary the crate returns (pinned to the version tower-lsp re-exports, wasm-safe), so the server edge passes values through with no conversion.

Entities Entity diagram scroll to zoom · drag to pan
RECORDPositionlinenumbercharacternumber
data

Range #

public
lsp_core::Range

A half-open text range between two positions.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDRangestartlsp_core::Positionendlsp_core::PositionRECORDPositionlinenumbercharacternumber
component

Refs #

public
lsp_core::Refs

References and rename: every occurrence of the symbol under the caret across the workspace, the document highlights for it, and the workspace-wide rename edits.

Parent

Scenarios

RenameAcrossWorkspace

Rename rewrites every occurrence of one definition across the workspace.

  • given the caret on a renameable symbol
  • when rename runs
  • then every identifier resolving to the same definition is collected
  • and each occurrence is rewritten across all files that reference it
  • but a `::` module qualifier is never treated as an occurrence
Flow Flow — RenameAcrossWorkspace scroll to zoom · drag to pan
FEATURERenameAcrossWorkspacefor RefsGIVENthe caret on a renameable symbolWHENrename runsTHENevery identifier resolving to the samedefinition is collectedANDeach occurrence is rewritten acrossall files that reference itBUTa `::` module qualifier is nevertreated as an occurrence
component

Semantic #

public
lsp_core::Semantic

Semantic tokens: AST-aware highlighting that colours each token by its declared role, plus the legend the editor binds.

Parent

Scenarios

ColourByDeclaredRole

Semantic tokens colour identifiers by their declared role.

  • given a parsed module
  • when full semantic tokens are requested
  • then each identifier is coloured by its role — node, data, callable, parameter
  • and keywords, docs, and literals are coloured too
  • but overlapping, multi-line, or zero-width spans are dropped before encoding
Flow Flow — ColourByDeclaredRole scroll to zoom · drag to pan
FEATUREColourByDeclaredRolefor SemanticGIVENa parsed moduleWHENfull semantic tokens are requestedTHENeach identifier is coloured by itsrole — node, data, callable, parameterANDkeywords, docs, and literals arecoloured tooBUToverlapping, multi-line, or zero-widthspans are dropped before encoding
component

Symbols #

public
lsp_core::Symbols

Document and workspace structure: the outline symbols, the foldable ranges, and the workspace-wide symbol query.

Parent

data

TextEdit #

public
lsp_core::TextEdit

A text edit: replace `range` with `newText`. Formatting and rename return these.

Entities Entity diagram scroll to zoom · drag to pan
RECORDTextEditrangelsp_core::RangenewTextstringRECORDRangestartlsp_core::Positionendlsp_core::Position
Generated by pds doc.