gitmyhub

zls

Zig ★ 5.0k updated 6d ago

A language server for Zig supporting developers with features like autocomplete and goto definition

ZLS is a community-built Language Server Protocol implementation for Zig, providing autocomplete, go-to-definition, inline diagnostics, rename, find references, semantic highlighting, and code formatting to any LSP-compatible editor.

ZigLanguage Server ProtocolZig Build Systemsetup: easycomplexity 2/5

ZLS is a language server for the Zig programming language. A language server is a background process that connects to a code editor and provides smart editing features such as autocomplete suggestions, go-to-definition, hover documentation, and error highlighting as you type. ZLS brings those capabilities to Zig developers using any editor that supports the Language Server Protocol, a standard communication format that many modern editors understand.

The supported features include code completions, inline diagnostics with optional build-on-save checking, go to definition and declaration, workspace and document symbol search, find all references, rename symbol, code formatting through the standard Zig formatter, semantic highlighting, inlay hints, and code actions. Support for Zig's compile-time evaluation features is noted as still in progress.

Installation instructions and editor-specific setup guides are hosted on the Zigtools website rather than the README itself. The project can also be built from source using Zig's own build system with a single command. Because ZLS tracks the Zig compiler closely, users are advised to update both at the same time when upgrading, since the two need to stay in sync.

ZLS is a community project, not an official tool from the Zig core team. It is open source under the MIT license and accepts financial contributions through Open Collective to support ongoing development.

Where it fits