Pelago

Language server

Editor features from pelago lsp.

pelago lsp is a language server built into the compiler. It speaks the Language Server Protocol over standard input and output, so any editor with a client can use it. The VS Code and Zed extensions start it for you.

Features

FeatureWhat you get
DiagnosticsErrors and warnings from every compiler stage as you type, cleared as soon as they are fixed.
HoverA function's signature, the shape of a type, or the type of an expression.
Go to definitionWorks across the files of a package.
Find referencesEvery use of a name in the package.
RenameRenames a name and all its uses; the library and built-ins cannot be renamed.
CompletionKeywords, declarations, locals and the members of a value's type after a dot.
Signature helpThe parameters of a call.
OutlineThe functions and types of the current file.
Semantic coloursHighlighting that knows functions from methods and types from variables.
FormattingThe same layout as pelago fmt.

Limits

The checker looks at the whole package each time a file changes. That is fast for small and medium projects.

Using it from another editor

Start pelago lsp as the server for .pel files with no arguments. If your editor cannot find pelago, give it the full path to the executable.

On this page