meeko lsp
Starts the language server for .meeko components, used by VS Code, Neovim, Helix, Zed and JetBrains.
meeko lsp starts Meeko's language server (LSP): diagnostics, completion, hover, go to definition, quick fixes, CodeLens, Prettier formatting, semantic reactivity tokens and page and layout contract checking for .meeko files. It speaks JSON-RPC over the specified transport, usually standard input and output. You do not run it manually: the editor launches it.
It is the same program as the package's meeko-language-server binary; both accept the same transports.
Usage#
meeko lsp --stdioIn Neovim 0.11, with nvim-lspconfig:
vim.filetype.add({ extension = { meeko = "meeko" } })
vim.lsp.config("meeko", {
cmd = { "npx", "meeko-language-server", "--stdio" },
filetypes = { "meeko" },
root_markers = { "package.json", "tsconfig.json" },
init_options = { trusted = true },
})
vim.lsp.enable("meeko")Type#
meeko lsp --stdio | --node-ipc | --socket=<puerto> | --pipe=<nombre>Options#
| Option | Type | Default | Description |
|---|---|---|---|
--stdio |
transport | JSON-RPC over stdin and stdout. Used by almost all editors. | |
--node-ipc |
transport | Node's IPC channel, for a client that launches the server with fork. |
|
--socket=<puerto> |
transport | A TCP socket on that port. | |
--pipe=<nombre> |
transport | A named pipe (a named pipe on Windows, a domain socket on POSIX). |
Server options go in initializationOptions of initialize, not on the command line: trusted (true by default: executes meeko.config.* and module setup functions), projectContracts, diagnosticsDelay and format. See Initialization options.
Result#
A process that serves the editor until it closes the connection. While running:
- stdout belongs to the protocol. With
--stdio, anything project code writes withconsole.log,info,warn,errorordebugis sent to the client log, not stdout, to avoid corrupting the protocol. - Checks the project. In a trusted workspace it generates component declarations and checks page, layout and error page contracts (
MEEK_PAGE_PROPS,MEEK_LAYOUT_PROPS,MEEK_ERROR_PROPS) 450 ms after each saved change. - Reads the project. The package root's
tsconfig.json,meeko.config.*and files in.meeko/types/.
Without a transport, it prints Uso: meeko lsp --stdio | --node-ipc | --socket=<puerto> | --pipe=<nombre> to standard error and exits with code 1.
Examples#
Helix#
# .helix/languages.toml
[language-server.meeko]
command = "npx"
args = ["meeko-language-server", "--stdio"]
config = { trusted = true }
[[language]]
name = "meeko"
scope = "source.meeko"
file-types = ["meeko"]
roots = ["package.json", "tsconfig.json"]
grammar = "html"
block-comment-tokens = { start = "<!--", end = "-->" }
language-servers = ["meeko"]hx --health meeko confirms that Helix finds the server.
Open third-party code without executing it#
init_options = { trusted = false },With trusted: false, the server does not execute meeko.config.* or modules: it reads configuration statically (literal layers and imports lists) and skips contract checking. The VS Code extension sends this according to workspace trust.
Check that it starts#
npx meeko lspUso: meeko lsp --stdio | --node-ipc | --socket=<puerto> | --pipe=<nombre>If you see this line, the binary resolves and Node 24 runs it; the editor must pass --stdio.
Common mistakes#
Launch it without a transport#
meeko lspUso: meeko lsp --stdio | --node-ipc | --socket=<puerto> | --pipe=<nombre> and exit code 1. Another value, such as --tcp, produces the same result.
meeko lsp --stdioUse the global server instead of the project's server#
cmd = { "meeko-language-server", "--stdio" }, -- installed with npm i -gA global @meekojs/meeko of another version compiles components using a different compiler and types than meeko check and meeko build: editor diagnostics do not match CI diagnostics.
cmd = { "npx", "meeko-language-server", "--stdio" },npx (or pnpm exec) uses the binary in the project's node_modules/.bin.
Notes#
- Help. Since
1.7,meeko --helplists all four transports (previously only--stdio) andmeeko lsp --helpprints the command's help without starting the server. - Security. With
trusted: true, opening a project executes itsmeeko.config.*and modulesetupfunctions with Node, likemeeko check. Usetrusted: falsefor unfamiliar code. - Requirements. Node 24 or later and
@meekojs/meekoinstalled in the project. Components are recognized by the.meekoextension; thelanguageIdsent by the editor does not matter. - Performance. Component diagnostics wait
diagnosticsDelay(300 ms) after the last edit, and project checking waits 450 ms after saving; changes in.meeko/andnode_modulesdo not trigger it. - Windows and POSIX. With
--pipe, the name follows platform conventions; with--stdiothere are no differences.