ZLS 0.17.0

Feature improvements

Don’t follow aliases when renaming symbol (#3199)

Consider the following source file:

const S = struct {
    fn foo() void {}
};
comptime {
    const foo = S.foo;
    foo();
}

Build System Integration

During the Zig 0.17 development cycle, the separation of maker process and configurer process has broken critical build system integration features in ZLS. Most of them have since been restored using the build system protocol but various regressions remain that are anticipated to be resolved during the next release cycle.

On the positive side, the new protocol lays the foundation for future improvements in ZLS and related tooling. Especially editors could utilize it to integrate unit testing, fuzzing, code coverage reports or debugging capabilities that are fully aware of the Zig build system.

All known regressions are tracked in #3277 and listed below:

Package @imports in build.zig

Type resolution for package imports in build.zig files have regressed.

Upstream Zig Issue: ziglang/zig#36387

Module @imports to exported modules without a compile step

Type resolution for modules that are only exported using b.addModule but aren’t tied to a compile step have regressed.

An build.zig file that would be affected:

const std = @import("std");
pub fn build(b: *std.Build) void {
    _ = b.addModule("foo", .{
        .root_source_file = b.path("root.zig"),
        .imports = &.{
            .{ .name = "bar", .module = b.createModule(.{ .root_source_file = b.path("bar.zig") }) },
        },
    });
}

In the above example, @import("bar") will not be resolved.

Upstream Zig Issue: ziglang/zig#36388

Build system protocol file watching doesn’t work on windows

File watching has regressed on windows due to a bug in the build system protocol. This does not affect the CLI when running zig build --watch.

ZLS does work around this issue by receiving file save events through the LSP protocol. File changes through external programs (e.g. version control) will not be detected.

Upstream Zig Issue: ziglang/zig#37236

Contributors

Here is a list of everyone who has made at least one contribution to this release of ZLS:

Sponsors

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!

OpenCollective Backers

Full Changelog: 0.16.0…0.17.0

Release Artifacts

All files are signed with minisign using this public key:

RWR+9B91GBZ0zOjh6Lr17+zKf5BoSuFvrx2xSeDE57uIYvnKBGmMjOex
OSArchFilenameSignatureSize
Windowsx86_64zls-x86_64-windows-0.17.0.zip minisig4.65 MiB
Windowsaarch64zls-aarch64-windows-0.17.0.zip minisig4.38 MiB
Windowsx86zls-x86-windows-0.17.0.zip minisig4.71 MiB
macOSx86_64zls-x86_64-macos-0.17.0.tar.xz minisig1.16 MiB
macOSaarch64zls-aarch64-macos-0.17.0.tar.xz minisig1.02 MiB
Linuxx86_64zls-x86_64-linux-0.17.0.tar.xz minisig3.88 MiB
Linuxaarch64zls-aarch64-linux-0.17.0.tar.xz minisig3.65 MiB
Linuxarmzls-arm-linux-0.17.0.tar.xz minisig3.83 MiB
Linuxriscv64zls-riscv64-linux-0.17.0.tar.xz minisig4.39 MiB
Linuxpowerpc64lezls-powerpc64le-linux-0.17.0.tar.xzminisig3.77 MiB
Linuxx86zls-x86-linux-0.17.0.tar.xz minisig3.88 MiB
Linuxloongarch64zls-loongarch64-linux-0.17.0.tar.xzminisig4 MiB
Linuxs390xzls-s390x-linux-0.17.0.tar.xz minisig4.15 MiB
WASIwasm32zls-wasm32-wasi-0.17.0.tar.xz minisig2.36 MiB