explaingit

zigtools/zls

4,789ZigAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

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.

Mindmap

mindmap
  root((ZLS))
    Editor Features
      Autocomplete
      Go to Definition
      Find References
      Rename Symbol
    Diagnostics
      Inline Errors
      Build on Save
      Semantic Highlighting
    Code Navigation
      Workspace Symbols
      Document Symbols
      Inlay Hints
    Formatting
      Zig Formatter
      Code Actions
    Installation
      Prebuilt Binaries
      Build from Source
    Community
      MIT License
      Open Collective
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add smart Zig autocomplete and error highlighting to VS Code, Neovim, or any LSP-compatible editor

USE CASE 2

Get go-to-definition and find-all-references while navigating an unfamiliar Zig codebase

USE CASE 3

Enable build-on-save diagnostics to catch Zig compile errors without leaving your editor

USE CASE 4

Auto-format Zig source files on save using the standard Zig formatter via ZLS

Tech stack

ZigLanguage Server ProtocolZig Build System

Getting it running

Difficulty · easy Time to first run · 30min

Install ZLS matching your exact Zig compiler version, the two must stay in sync. Build from source with one Zig build command, or use prebuilt binaries. Editor setup guides are on the Zigtools website.

MIT license, free to use, modify, and distribute with attribution. No restrictions on commercial use.

In plain English

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.

Copy-paste prompts

Prompt 1
I have ZLS running in my editor. Here is a Zig file with a compile error. Explain what the error means and how to fix it.
Prompt 2
Using this Zig codebase, walk me through how to add a new public function, including the correct type signatures and doc comments that ZLS will surface on hover.
Prompt 3
I want to configure ZLS in Neovim using nvim-lspconfig. Write the minimal Lua config to attach ZLS to .zig files with build-on-save diagnostics enabled.
Prompt 4
Explain how Zig comptime feature interacts with LSP features like autocomplete, what works today in ZLS and what is still in progress?
Prompt 5
I am building ZLS from source and it crashes on startup. Here is my Zig version and ZLS version. What version mismatch issues should I check first?
Open on GitHub → Explain another repo

← zigtools on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.