Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

wcl lsp

Start the WCL Language Server Protocol (LSP) server.

Usage

wcl lsp [options]

Options

FlagDescription
--tcp <addr>Listen on a TCP address instead of stdio (e.g. 127.0.0.1:9257)

Description

wcl lsp starts the WCL language server, which implements the Language Server Protocol. Editors and IDEs connect to it to receive language intelligence features for WCL documents.

By default, the server communicates over stdio, which is the standard transport for most editor integrations (VS Code, Neovim, Helix, etc.). The --tcp flag enables a TCP transport useful for debugging or unconventional editor setups.

Features

FeatureDescription
DiagnosticsReal-time errors and warnings as you type, sourced from the full pipeline
HoverType information and documentation for identifiers, blocks, and schema fields
Go to definitionJump to where a name, macro, schema, or imported identifier is defined
CompletionsContext-aware completions for identifiers, attribute names, block types, and decorators
Semantic tokensSyntax highlighting based on semantic meaning (not just token type)
Signature helpParameter hints when calling macros or functions
Find referencesLocate all uses of a definition across the document
FormattingFull-document formatting via wcl fmt

Editor Integration

VS Code

Install the wcl-vscode extension. It starts wcl lsp automatically.

Neovim (nvim-lspconfig)

require('lspconfig').wcl.setup({
  cmd = { 'wcl', 'lsp' },
  filetypes = { 'wcl' },
  root_dir = require('lspconfig.util').root_pattern('.git', '*.wcl'),
})

Helix

Add to languages.toml:

[[language]]
name = "wcl"
language-servers = ["wcl-lsp"]

[language-server.wcl-lsp]
command = "wcl"
args = ["lsp"]

Examples

Start in stdio mode (used by editors automatically):

wcl lsp

Start on a TCP port for debugging:

wcl lsp --tcp 127.0.0.1:9257