marko/lsp
Language Server Protocol implementation for Marko — powers editor completions, diagnostics, go-to-definition, hover, and code lenses for Marko-specific semantics. marko/lsp runs as a stdio JSON-RPC server (marko lsp:serve) that any LSP-capable editor can connect to.
It builds on marko/codeindexer: rather than re-parsing the project, the language server reads the cached symbol index, so completions and navigation reflect the same module graph the rest of the tooling sees. (Installing marko/lsp pulls in marko/codeindexer automatically.)
Installation
Section titled “Installation”composer require marko/lspStart the server (editors launch this for you once configured):
marko lsp:serveConfigure your editor to launch it. Example for Neovim with nvim-lspconfig:
require('lspconfig').marko.setup({ cmd = { 'marko', 'lsp:serve' },})Capabilities
Section titled “Capabilities”The server advertises the following on initialize:
| Capability | What it provides |
|---|---|
completionProvider | Completion for config keys, template names, translation keys, and Marko attribute parameters |
definitionProvider | Go-to-definition for config keys, templates, and translations |
diagnosticProvider | Diagnostics for unknown config keys, unresolved templates, and missing translations |
codeLensProvider | Inverse-index code lenses (e.g. “who observes this event”, “what plugins target this class”) |
hoverProvider | Hover documentation for Marko semantics |
Feature coverage is implemented by focused feature classes — config keys, templates, translations, attributes, and code lenses — each wired into the protocol dispatch.
Related Packages
Section titled “Related Packages”marko/codeindexer— the cached index the language server readsmarko/mcp— the MCP server peer that exposes the same index to AI agents