zls Documentation

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

5,251 stars Zig Zig 1 file ยท ~627 tokens #language-server#lsp#lsp-server#zig#zls
RAW Doc

Technical Documentation: zigtools/zls

โ„น๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference

Overview (`README.md`)




ZLS is a non-official implementation of the Language Server Protocol for Zig in Zig. It provides developers with IDE features in their editor.

Installation

The complete installation guide is available on the Zigtools website. It covers editor setup, prebuilt binaries and additional documentation.

Build From Source

The default branch of ZLS targets Zig master.

bash
git clone https://github.com/zigtools/zls
cd zls
zig build -Doptimize=ReleaseSafe

When upgrading Zig, make sure to update ZLS too keep them in sync.

Features

ZLS supports most language features, including simple type function support, payload capture type resolution, custom packages, and others. Support for comptime and semantic analysis is Work-in-Progress.

The majority of LSP features are supported:

  • Completions
  • Hover
  • Diagnostics and opt-in build-on-save
  • Go to definition/declaration
  • Workspace symbols and document symbols
  • Find references and rename symbol
  • Formatting based on zig fmt
  • Semantic tokens highlighting
  • Inlay hints
  • Code actions

Quick Thanks :)

We'd like to take a second to thank all our awesome contributors and donators/backers/sponsors; if you have time or money to spare, consider partaking in either of these options - they help keep ZLS awesome for everyone!


Overview (`src/analyser/README.md`)

This directory contains mostly future work on an improved analysis backend. Only a fractions of this code is being used. For the current analysis backend implementation, See src/analysis.zig.


--- METRICS ---