Skip to content

Language Server

Wippy includes a built-in LSP (Language Server Protocol) server that provides IDE features for Lua code. The server runs as part of the Wippy runtime and connects to editors via TCP or HTTP.

  • Code completion with type-aware suggestions
  • Hover information showing types and signatures
  • Go to definition
  • Find references
  • Document and workspace symbols
  • Call hierarchy (incoming and outgoing calls)
  • Real-time diagnostics (parse errors, type errors)
  • Signature help for function parameters

Enable the LSP server in .wippy.yaml:

version: "1.0"
lua:
type_system:
enabled: true
lsp:
enabled: true
address: ":7777"
FieldDefaultDescription
enabledfalseEnable the TCP server
address:7777TCP listen address
http_enabledfalseEnable the HTTP transport
http_address:7778HTTP listen address
http_path/lspHTTP endpoint path
http_allow_origin*CORS allowed origin
max_message_bytes8388608Max incoming message size (bytes)

The TCP server speaks JSON-RPC 2.0 with standard LSP message framing (Content-Length headers). This is the primary transport for editor integrations.

The HTTP transport accepts POST requests with JSON-RPC payloads. Useful for browser-based editors and web tools. CORS headers are included for cross-origin access.

lsp:
enabled: true
http_enabled: true
http_address: ":7778"
http_path: "/lsp"
http_allow_origin: "*"

The LSP server uses the wippy:// URI scheme to identify registry entries:

wippy://namespace:entry_name

Editors map these URIs to entry IDs in the registry. Both wippy:// scheme and raw namespace:entry_name formats are accepted.

The LSP server maintains an index of all code entries for fast lookups. Indexing happens in the background using multiple workers.

Key behaviors:

  • Entries are indexed in dependency order (dependencies first)
  • Changes trigger re-indexing of affected entries
  • Unsaved editor changes are stored in an overlay
  • Index is incremental - only changed entries are re-processed
MethodDescription
initializeCapability negotiation
textDocument/didOpenTrack opened documents
textDocument/didChangeFull document sync
textDocument/didCloseRelease documents
textDocument/hoverType info at cursor
textDocument/definitionJump to definition
textDocument/referencesFind all references
textDocument/completionCode completion
textDocument/signatureHelpFunction signatures
textDocument/diagnosticFile diagnostics
textDocument/documentSymbolFile symbols
workspace/symbolGlobal symbol search
textDocument/prepareCallHierarchyCall hierarchy
callHierarchy/incomingCallsFind callers
callHierarchy/outgoingCallsFind callees

The completion engine resolves types through the code graph. It provides:

  • Member completion after . and : (fields, methods)
  • Local variable completion
  • Module-level symbol completion
  • Trigger characters: ., :

Diagnostics are computed during indexing and include:

  • Parse errors (syntax problems)
  • Type checking errors (mismatches, undefined symbols)
  • Severity levels: error, warning, information, hint

Diagnostics update as you type through the document overlay system.