Skip to content

Conversation

@RafaelVVolkmer
Copy link

@RafaelVVolkmer RafaelVVolkmer commented Aug 15, 2025

This PR updates zls to match recent Zig standard library changes:

1. Adapt to std.ArrayList default change (ziglang/zig#24801)

In Zig 0.15.0-dev.1519, std.ArrayList now defaults to the unmanaged variant, breaking code that assumed the managed version.

Changes:

  • Added per-file aliases:
    • ArrayListUnmanagedstd.ArrayList
    • ArrayListManagedstd.array_list.Managed
  • Replaced std.ArrayList with ArrayListManaged where memory management is required.
  • Replaced with ArrayListUnmanaged where unmanaged behavior is desired.

2. Migrate std.getWritten() to std.written() (ziglang/zig#24826)

Zig replaced std.getWritten() with std.written(), deprecating the old function name.

Changes:

  • Updated all occurrences of std.getWritten() to std.written() for consistency with the current API.

Zig 0.15.0-dev.1519 made std.ArrayList default to the unmanaged variant,
breaking code that expected the managed one.

Add per-file aliases where std.ArrayList is used:
  - ArrayListUnmanaged -> std.ArrayList
  - ArrayListManaged   -> std.array_list.Managed

Replace uses of std.ArrayList with ArrayListManaged where management is
required, and std.ArrayListUnmanaged with the new default.

Refers-To: ziglang/zig#24801

Signed-off-by: Rafael V. Volkmer <rafael.v.volkmer@gmail.com>
Zig 0.15.0-dev.XXXX renamed std.getWritten() to std.written(),
deprecating the old function name.

Update all occurrences of std.getWritten() to std.written()
for consistency with the current Zig standard library.

Refers-To: ziglang/zig#24826

Signed-off-by: Rafael V. Volkmer <rafael.v.volkmer@gmail.com>
@RafaelVVolkmer RafaelVVolkmer changed the title zls: fix build after std.ArrayList default switched to unmanaged Update new standard library usages to be compatible with Zig 0.15.0, ensuring the code remains compliant with the new version Aug 15, 2025
@RafaelVVolkmer RafaelVVolkmer changed the title Update new standard library usages to be compatible with Zig 0.15.0, ensuring the code remains compliant with the new version Update new std library usages to be compatible with Zig 0.15.0 Aug 15, 2025
@RafaelVVolkmer RafaelVVolkmer changed the title Update new std library usages to be compatible with Zig 0.15.0 zls: adapt to std.ArrayList default change and std.getWritten() rename Aug 15, 2025
@RafaelVVolkmer RafaelVVolkmer changed the title zls: adapt to std.ArrayList default change and std.getWritten() rename Adapt new standard library usages for compatibility with Zig 0.15.0 Aug 15, 2025
@Techatrix
Copy link
Member

There are some changes that would need to be made to get this PR merged. To avoid any further delays in review, I am going to do this fix myself. Thank you for the effort nonetheless.

@Techatrix Techatrix closed this Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants