Versions in this module Expand all Collapse all v0 v0.2.0 Nov 22, 2026 v0.1.0 Sep 6, 2026 Changes in this version + const LSPDocumentLanguageID + var ErrDefinitionMissing = errors.New("symbol has no resolvable definition") + var ErrEditLimit = errors.New("graph node rename exceeds the edit bound") + var ErrFormattingUnavailable = errors.New("editor formatting requires a strictly parsed topology") + var ErrInvalidEdgeMutation = errors.New("invalid graph edge mutation") + var ErrInvalidPosition = errors.New("editor position is invalid") + var ErrInvalidRename = errors.New("invalid graph node rename") + var ErrLSPDisposed = errors.New("LSP adapter is disposed") + var ErrLSPDocumentMissing = errors.New("LSP document is not open") + var ErrLSPDocumentOpen = errors.New("LSP document is already open") + var ErrLSPNotInitialized = errors.New("LSP adapter is not initialized") + var ErrLSPVersion = errors.New("LSP document version is stale") + var ErrNoCompletionContext = errors.New("position has no completion context") + var ErrNoSymbol = errors.New("position does not name a graph symbol") + var ErrPresentationLimit = errors.New("editor presentation exceeds its byte bound") + var ErrRenameCollision = errors.New("graph node rename collides with an existing node") + var ErrStalePosition = errors.New("editor position belongs to another source revision") + var ErrSyntaxUnavailable = errors.New("editor operation requires canonical parsed topology") + var ErrWorkspaceAmbiguous = errors.New("editor workspace navigation target is ambiguous") + var ErrWorkspaceIdentity = errors.New("editor workspace document identity is invalid") + var ErrWorkspaceLimit = errors.New("editor workspace exceeds its bound") + func ApplyEdits(source []byte, editSet EditSet) ([]byte, error) + type Completion struct + Detail string + Element string + InsertText string + Kind CompletionKind + Label string + Node string + Port string + Replacement syntax.Span + Type string + type CompletionKind string + const CompletionElement + const CompletionNode + const CompletionPort + type CompletionList struct + Incomplete bool + Items []Completion + Total int + type ConfigContract struct + AdditionalProperties json.RawMessage + Artifact string + EmptyObjectOnly bool + InlineTopologyValues bool + Properties []ValuesPropertyMetadata + PropertiesComplete bool + Resolved bool + SchemaDigest string + SchemaID string + SchemaReference string + SchemaStatus ConfigSchemaStatus + type ConfigSchemaStatus string + const ConfigSchemaEmpty + const ConfigSchemaInvalid + const ConfigSchemaResolved + const ConfigSchemaUnresolved + type Cursor struct + Position syntax.Position + SourceDigest string + type Definition struct + Element string + Kind SymbolKind + Node string + Port string + Span *syntax.Span + URI string + type DefinitionList struct + Items []Definition + type Diagnostic struct + Code string + Message string + Notes []string + Path string + Severity Severity + Span syntax.Span + type DiagnosticReport struct + Incomplete bool + Items []Diagnostic + Total int + type Document struct + func Analyze(path string, source []byte, catalog *resolve.Catalog, limits Limits) (*Document, error) + func AnalyzeWithOptions(ctx context.Context, path string, source []byte, catalog *resolve.Catalog, ...) (*Document, error) + func (document *Document) Canonical() bool + func (document *Document) CatalogMetadata() MetadataReport + func (document *Document) Complete(cursor Cursor) (CompletionList, error) + func (document *Document) CompleteElements(cursor Cursor) (CompletionList, error) + func (document *Document) CompleteNodes(cursor Cursor) (CompletionList, error) + func (document *Document) CompletePorts(cursor Cursor) (CompletionList, error) + func (document *Document) CreateEdgeID(edgeID string, from, to syntax.Endpoint, delivery syntax.Delivery) (EditSet, error) + func (document *Document) Cursor(offset int) (Cursor, error) + func (document *Document) Definitions(cursor Cursor) (DefinitionList, error) + func (document *Document) Diagnostics() DiagnosticReport + func (document *Document) ElementCompletions(cursor Cursor, prefix string) (CompletionList, error) + func (document *Document) FormatEdits() (EditSet, error) + func (document *Document) Hover(cursor Cursor) (Hover, error) + func (document *Document) LSPCompletions(position LSPPosition) (LSPCompletionList, error) + func (document *Document) LSPConfigurationHover(position LSPPosition) (LSPHover, error) + func (document *Document) LSPDefinitions(position LSPPosition, identity LSPDocumentIdentity) ([]LSPLocationLink, error) + func (document *Document) LSPDiagnostics() (LSPFullDocumentDiagnosticReport, error) + func (document *Document) LSPFormatting(identity LSPDocumentIdentity) (LSPWorkspaceEdit, error) + func (document *Document) LSPRename(position LSPPosition, newName string, identity LSPDocumentIdentity) (LSPWorkspaceEdit, error) + func (document *Document) LSPVirtualDescriptorDocument(elementName string) (LSPVirtualDocument, error) + func (document *Document) NodeCompletions(cursor Cursor, prefix, port string, direction element.Direction) (CompletionList, error) + func (document *Document) Parsed() bool + func (document *Document) Path() string + func (document *Document) PortCompletions(cursor Cursor, node, prefix string, direction element.Direction) (CompletionList, error) + func (document *Document) Recovered() bool + func (document *Document) RemoveEdgeID(edgeID string) (EditSet, error) + func (document *Document) RenameNode(cursor Cursor, newName string) (EditSet, error) + func (document *Document) RenameNodeID(node, newName string) (EditSet, error) + func (document *Document) Source() []byte + func (document *Document) SourceDigest() string + func (document *Document) ValidateCursor(cursor Cursor) error + type EditSet struct + Edits []TextEdit + Path string + SourceDigest string + type ElementMetadata struct + CompositeFingerprint string + Config ConfigContract + Dependencies []element.Dependency + Effects []element.Effect + Generics []string + Identity element.Identity + Ports []PortMetadata + Reaction ReactionMetadata + StateSchema string + StateTransfer *element.StateTransferCapabilities + TopologyDeclaration string + type Hover struct + Config *NodeConfigContract + Descriptor *ElementMetadata + ElementReference string + Kind SymbolKind + Node string + Port *PortMetadata + Range syntax.Span + type LSPAdapter struct + func NewLSPAdapter(catalog *resolve.Catalog, options LSPAdapterOptions) (*LSPAdapter, error) + func (adapter *LSPAdapter) Dispose() + func (adapter *LSPAdapter) DocumentCount() int + func (adapter *LSPAdapter) HandleJSONRPC(ctx context.Context, source []byte) ([]byte, error) + type LSPAdapterLimits struct + MaxDocuments int + MaxIDBytes int + MaxMethodBytes int + MaxRequestBytes int + MaxResponseBytes int + MaxURIBytes int + type LSPAdapterOptions struct + Editor Options + Limits LSPAdapterLimits + Workspace WorkspaceLimits + type LSPCompletionData struct + Element string + ElementDigest string + ElementRevision uint64 + Kind CompletionKind + Node string + Port string + SourceDigest string + Type string + type LSPCompletionItem struct + Data LSPCompletionData + Detail string + FilterText string + InsertTextFormat int + Kind LSPCompletionItemKind + Label string + SortText string + TextEdit LSPTextEdit + type LSPCompletionItemKind int + const LSPCompletionClass + const LSPCompletionField + const LSPCompletionVariable + type LSPCompletionList struct + IsIncomplete bool + Items []LSPCompletionItem + type LSPDiagnostic struct + Code string + Data LSPDiagnosticData + Message string + Range LSPRange + Severity LSPDiagnosticSeverity + Source string + type LSPDiagnosticData struct + Notes []string + Path string + SourceDigest string + type LSPDiagnosticSeverity int + const LSPDiagnosticError + const LSPDiagnosticWarning + type LSPDocumentIdentity struct + Path string + SourceDigest string + URI string + Version int + type LSPFullDocumentDiagnosticReport struct + Items []LSPDiagnostic + Kind string + type LSPHover struct + Contents LSPMarkupContent + Range LSPRange + type LSPLocationLink struct + OriginSelectionRange LSPRange + TargetRange LSPRange + TargetSelectionRange LSPRange + TargetURI string + type LSPMarkupContent struct + Kind string + Value string + type LSPPosition struct + Character int + Line int + type LSPRange struct + End LSPPosition + Start LSPPosition + type LSPTextDocumentEdit struct + Edits []LSPTextEdit + TextDocument LSPVersionedTextDocumentIdentifier + type LSPTextEdit struct + NewText string + Range LSPRange + type LSPVersionedTextDocumentIdentifier struct + URI string + Version int + type LSPVirtualDocument struct + LanguageID string + Text string + URI string + type LSPWorkspaceEdit struct + DocumentChanges []LSPTextDocumentEdit + type Limits struct + MaxCatalogBytes int + MaxCatalogElements int + MaxCatalogPorts int + MaxGraphStatements int + MaxIdentifierBytes int + MaxPathBytes int + MaxRenameEdits int + MaxResolvedSchemaBytes int + MaxResultItems int + MaxSchemaProperties int + MaxSourceBytes int + MaxTotalResolvedSchemaBytes int + func DefaultLimits() Limits + type MetadataReport struct + Elements []ElementMetadata + Incomplete bool + Total int + type NodeConfigContract struct + ValuesPath string + type NormalizedDocument struct + func AnalyzeNormalized(path string, source []byte, limits Limits) (*NormalizedDocument, error) + func (document *NormalizedDocument) CreateEdgeID(edgeID string, from, to syntax.Endpoint, delivery syntax.Delivery) (EditSet, error) + func (document *NormalizedDocument) Path() string + func (document *NormalizedDocument) RemoveEdgeID(edgeID string) (EditSet, error) + func (document *NormalizedDocument) RenameNodeID(oldName, newName string) (EditSet, error) + func (document *NormalizedDocument) Source() []byte + func (document *NormalizedDocument) SourceDigest() string + type Options struct + Limits Limits + SchemaLimits schema.Limits + SchemaResolver schema.Resolver + type PortMetadata struct + Cardinality element.Cardinality + DefaultDepth int + Direction element.Direction + LossAllowed bool + MinConnections int + Name string + ReactionRole string + Required bool + Type element.Type + type ReactionMetadata struct + BreaksCycles bool + Interrupts []string + MaxConcurrency int + Outcomes []string + SampledState []string + Triggers []string + type Severity string + const SeverityError + const SeverityWarning + type SymbolKind string + const SymbolElement + const SymbolNodeDeclaration + const SymbolNodeReference + const SymbolPortReference + type TextEdit struct + NewText string + OldText string + Span syntax.Span + type ValuesPropertyMetadata struct + Default json.RawMessage + Description string + Enum []json.RawMessage + Format string + Name string + Pointer string + Required bool + Schema json.RawMessage + Title string + Types []string + type WorkspaceDefinition struct + Kind WorkspaceDefinitionKind + OriginSelectionRange LSPRange + TargetDocument LSPDocumentIdentity + TargetRange LSPRange + TargetSelectionRange LSPRange + WorkspaceDigest string + type WorkspaceDefinitionKind string + const WorkspaceBoundaryDefinition + const WorkspaceImportDefinition + const WorkspaceSubgraphDefinition + type WorkspaceDocument struct + Identity LSPDocumentIdentity + Snapshot *Document + type WorkspaceIndex struct + func NewWorkspaceIndex(documents []WorkspaceDocument, configured WorkspaceLimits) (*WorkspaceIndex, error) + func (index *WorkspaceIndex) Definition(identity LSPDocumentIdentity, position LSPPosition) (result WorkspaceDefinition, handled bool, err error) + func (index *WorkspaceIndex) Documents() []LSPDocumentIdentity + func (index *WorkspaceIndex) Fingerprint() string + type WorkspaceLimits struct + MaxDocuments int + MaxImports int + MaxPathBytes int + MaxTotalSourceBytes int + func DefaultWorkspaceLimits() WorkspaceLimits