Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ fn initializedHandler(server: *Server, arena: std.mem.Allocator, notification: t
// `{ "watchers": [ { "globPattern": "**/*.{zig,zon}" } ] }`
var watcher = std.json.ObjectMap.init(arena);
try watcher.put("globPattern", .{ .string = "**/*.{zig,zon}" });
var watchers_arr = try std.ArrayList(std.json.Value).initCapacity(arena, 1);
var watchers_arr = try std.array_list.Managed(std.json.Value).initCapacity(arena, 1);
watchers_arr.appendAssumeCapacity(.{ .object = watcher });
var fs_watcher_obj: std.json.ObjectMap = std.json.ObjectMap.init(arena);
try fs_watcher_obj.put("watchers", .{ .array = watchers_arr });
Expand Down
4 changes: 2 additions & 2 deletions src/ast.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1139,11 +1139,11 @@ test "iterateChildren - fn_proto_* inside of fn_proto" {
);
defer tree.deinit(allocator);

var children_tags = std.ArrayList(Ast.Node.Tag).init(allocator);
var children_tags = std.array_list.Managed(Ast.Node.Tag).init(allocator);
defer children_tags.deinit();

const Context = struct {
accumulator: *std.ArrayList(Ast.Node.Tag),
accumulator: *std.array_list.Managed(Ast.Node.Tag),
fn callback(self: @This(), ast: Ast, child_node: Ast.Node.Index) !void {
try self.accumulator.append(ast.nodeTag(child_node));
}
Expand Down
13 changes: 6 additions & 7 deletions src/build_runner/master.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const builtin = @import("builtin");
const assert = std.debug.assert;
const mem = std.mem;
const process = std.process;
const ArrayList = std.ArrayList;
const Step = std.Build.Step;
const Allocator = std.mem.Allocator;

Expand Down Expand Up @@ -102,8 +101,8 @@ pub fn main() !void {
dependencies.root_deps,
);

var targets = ArrayList([]const u8).init(arena);
var debug_log_scopes = ArrayList([]const u8).init(arena);
var targets = std.array_list.Managed([]const u8).init(arena);
var debug_log_scopes = std.array_list.Managed([]const u8).init(arena);
var thread_pool_options: std.Thread.Pool.Options = .{ .allocator = arena };

var install_prefix: ?[]const u8 = null;
Expand Down Expand Up @@ -349,7 +348,7 @@ pub fn main() !void {
.max_rss_is_default = false,
.max_rss_mutex = .{},
.skip_oom_steps = skip_oom_steps,
.memory_blocked_steps = std.ArrayList(*Step).init(arena),
.memory_blocked_steps = std.array_list.Managed(*Step).init(arena),
.thread_pool = undefined, // set below

.claimed_rss = 0,
Expand Down Expand Up @@ -514,7 +513,7 @@ const Run = struct {
max_rss_is_default: bool,
max_rss_mutex: std.Thread.Mutex,
skip_oom_steps: bool,
memory_blocked_steps: std.ArrayList(*Step),
memory_blocked_steps: std.array_list.Managed(*Step),
thread_pool: std.Thread.Pool,

claimed_rss: usize,
Expand Down Expand Up @@ -1384,7 +1383,7 @@ const copied_from_zig = struct {
else => return err,
};

var zig_args = ArrayList([]const u8).init(b.allocator);
var zig_args = std.array_list.Managed([]const u8).init(b.allocator);
defer zig_args.deinit();

var it = mem.tokenizeAny(u8, stdout, " \r\n\t");
Expand Down Expand Up @@ -1419,7 +1418,7 @@ const copied_from_zig = struct {

fn execPkgConfigList(self: *std.Build, out_code: *u8) (std.Build.PkgConfigError || std.Build.RunError)![]const std.Build.PkgConfigPkg {
const stdout = try self.runAllowFail(&.{ "pkg-config", "--list-all" }, out_code, .Ignore);
var list = ArrayList(std.Build.PkgConfigPkg).init(self.allocator);
var list = std.array_list.Managed(std.Build.PkgConfigPkg).init(self.allocator);
errdefer list.deinit();
var line_it = mem.tokenizeAny(u8, stdout, "\r\n");
while (line_it.next()) |line| {
Expand Down
4 changes: 2 additions & 2 deletions src/features/diagnostics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ fn collectParseDiagnostics(tree: Ast, eb: *std.zig.ErrorBundle.Wip) error{OutOfM
aw.clearRetainingCapacity();
tree.renderError(err, &aw.writer) catch return error.OutOfMemory;
try notes.append(allocator, try eb.addErrorMessage(.{
.msg = try eb.addString(aw.getWritten()),
.msg = try eb.addString(aw.written()),
.src_loc = try errorBundleSourceLocationFromToken(tree, eb, err.token),
}));
}

aw.clearRetainingCapacity();
tree.renderError(current_error, &aw.writer) catch return error.OutOfMemory;
try eb.addRootErrorMessage(.{
.msg = try eb.addString(aw.getWritten()),
.msg = try eb.addString(aw.written()),
.src_loc = try errorBundleSourceLocationFromToken(tree, eb, current_error.token),
.notes_len = @intCast(notes.items.len),
});
Expand Down
2 changes: 1 addition & 1 deletion src/print_ast.zig
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ test PrintAst {
\\ }, // :2:5
\\};
\\
, aw.getWritten());
, aw.written());

// The output itself is syntactically valid Zig code.

Expand Down
2 changes: 1 addition & 1 deletion src/tools/config_gen.zig
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ fn generateVersionDataFile(allocator: std.mem.Allocator, version: []const u8, ou
writeMarkdownFromHtml(html, &markdown.writer) catch return error.OutOfMemory;

try writer.writeAll(" .documentation =\n");
var line_it = std.mem.splitScalar(u8, std.mem.trim(u8, markdown.getWritten(), "\n"), '\n');
var line_it = std.mem.splitScalar(u8, std.mem.trim(u8, markdown.written(), "\n"), '\n');
while (line_it.next()) |line| {
try writer.print(" \\\\{s}\n", .{std.mem.trimRight(u8, line, " ")});
}
Expand Down
4 changes: 2 additions & 2 deletions tests/analysis/generics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ fn MapUnmanaged(Context: type) type {
};
}

const some_list: std.ArrayListUnmanaged(u8) = .empty;
// ^^^^^^^^^ (ArrayListAlignedUnmanaged(u8))()
const some_list: std.array_list.Aligned(u8, null) = .empty;
// ^^^^^^^^^ (Aligned(u8))()

const some_list_items = some_list.items;
// ^^^^^^^^^^^^^^^ ([]u8)()
Expand Down
2 changes: 1 addition & 1 deletion tests/build_runner_check.zig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn main() !u8 {
try std.json.Stringify.encodeJsonStringChars(&.{std.fs.path.sep}, .{}, &aw.writer);

// The build runner will produce absolute paths in the output so we remove them here.
const actual = try std.mem.replaceOwned(u8, gpa, actual_unsanitized, aw.getWritten(), "");
const actual = try std.mem.replaceOwned(u8, gpa, actual_unsanitized, aw.written(), "");

// We also convert windows style '\\' path separators to posix style '/'.
switch (std.fs.path.sep) {
Expand Down
4 changes: 2 additions & 2 deletions tests/lsp_features/inlay_hints.zig
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ test "var decl" {
test "comptime return types" {
try testInlayHints(
\\const std<type> = @import("std");
\\const list<ArrayListAligned(ArrayListAligned(i32))> = std.ArrayList(std.ArrayList(i32)).init(allocator);
\\const innerList<ArrayListAligned(i32)> = list.items[0];
\\const list<AlignedManaged(AlignedManaged(i32))> = std.array_list.Managed(std.array_list.Managed(i32)).init(allocator);
\\const innerList<AlignedManaged(i32)> = list.items[0];
\\const nested<i32> = list.items[0].items[0];
, .{ .kind = .Type });

Expand Down