Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChildProcess change #485

Closed
wants to merge 2 commits into from
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
3 changes: 1 addition & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1454,8 +1454,7 @@ fn formattingHandler(arena: *std.heap.ArenaAllocator, id: types.RequestId, req:
return try respondGeneric(id, null_result_response);
};

var process = try std.ChildProcess.init(&[_][]const u8{ zig_exe_path, "fmt", "--stdin" }, allocator);
defer process.deinit();
var process = std.ChildProcess.init(&[_][]const u8{ zig_exe_path, "fmt", "--stdin" }, allocator);
process.stdin_behavior = .Pipe;
process.stdout_behavior = .Pipe;

Expand Down
7 changes: 3 additions & 4 deletions tests/sessions.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const initialize_msg_offs =
;

const Server = struct {
process: *std.ChildProcess,
process: std.ChildProcess,
request_id: u32 = 1,

fn start(initialization: []const u8, expect: ?[]const u8) !Server {
Expand Down Expand Up @@ -103,12 +103,11 @@ const Server = struct {
// FIXME this shutdown request fails with a broken pipe on stdin on the CI
self.request("shutdown", "{}", null) catch @panic("Could not send shutdown request");
// waitNoError(self.process) catch @panic("Server error");
self.process.deinit();
}
};

fn startZls() !*std.ChildProcess {
var process = try std.ChildProcess.init(&[_][]const u8{"zig-out/bin/zls" ++ suffix}, allocator);
fn startZls() !std.ChildProcess {
var process = std.ChildProcess.init(&[_][]const u8{"zig-out/bin/zls" ++ suffix}, allocator);
process.stdin_behavior = .Pipe;
process.stdout_behavior = .Pipe;
process.stderr_behavior = .Inherit;
Expand Down