For Zig 0.17 · Latest release →

A language server
for Zig.

Built on an incremental query engine. Errors come only from Zig itself, comptime is evaluated, and the project model comes from the official build system.

$ brew install jinzhongjia/tap/zig-analyzer
geometry.zig
1const std = @import("std");
2
3const Point = struct { x: i32, y: i32 };
4
5fn manhattan(a: Point, b: Point) u32 {
6    return @abs(a.x - b.x) + @abs(a.y - b.y);
7}
8
9test manhattan {
10    const p: Point = .{ .x = 1, .y = 2 };
11    const d: u32 = manhattan(a:p, b:.{ .x = 4, .y = 6 });
12    try std.testing.expectEqual(7, d);
13}

// Features

Accuracy first: results are correct and complete, never truncated or approximated for speed.

Diagnostics from Zig

Errors come only from Zig itself: in-process AstGen while typing and zig build on save. Inactive code can optionally be marked.

Comptime evaluation

Generics and type constructors are evaluated, and generic function bodies are analyzed with the instances from their call sites.

Build system integration

The project model comes from the official build system protocol. Files without build.zig use single-file mode.

Navigation

Goto definition, declaration, and type definition; find references; document highlight; document and workspace symbols.

Editing

Completion with auto-import and snippets, hover, signature help, inlay hints, and semantic tokens.

Refactoring

Rename, plus code actions for unused names, var to const, missing switch prongs and struct fields, and organizing imports.

Formatting

Identical to zig fmt, for .zig and .zon, with one edit per changed region.

ZON files

Highlighting, formatting, and diagnostics in any .zon; completion, goto, and inlay hints for typed imports and build.zig.zon.

Opt-in hints

Naming checks from the Zig style guide with safe rename fixes, and unused private declarations. Comments suppress them per line or range.

// Install

Each package installs the ReleaseSafe build of the latest release, with its debug information.

macOS and Linux, with Homebrew:

brew install jinzhongjia/tap/zig-analyzer