fix inStream/outStream removal

This commit is contained in:
Vesim 2021-01-10 08:12:11 +01:00
parent eefee4759c
commit b2e456404c
4 changed files with 12 additions and 12 deletions

View File

@ -64,7 +64,7 @@ pub fn config(step: *std.build.Step) anyerror!void {
var file = try dir.createFile("zls.json", .{});
defer file.close();
const out = file.outStream();
const out = file.writer();
std.debug.warn("Writing to config...\n", .{});

View File

@ -80,7 +80,7 @@ pub fn getFunctionSnippet(allocator: *std.mem.Allocator, tree: *ast.Tree, func:
try buffer.appendSlice(tree.tokenSlice(name_tok));
try buffer.append('(');
var buf_stream = buffer.outStream();
var buf_stream = buffer.writer();
for (func.paramsConst()) |param, param_num| {
if (skip_self_param and param_num == 0) continue;

View File

@ -88,7 +88,7 @@ pub fn log(
}
// Code is largely based off of https://github.com/andersfr/zig-lsp/blob/master/server.zig
var stdout: std.io.BufferedOutStream(4096, std.fs.File.OutStream) = undefined;
var stdout: std.io.BufferedWriter(4096, std.fs.File.Writer) = undefined;
var allocator: *std.mem.Allocator = undefined;
var document_store: DocumentStore = undefined;
@ -155,7 +155,7 @@ fn respondGeneric(id: types.RequestId, response: []const u8) !void {
// Numbers of character that will be printed from this string: len - 1 brackets
const json_fmt = "{{\"jsonrpc\":\"2.0\",\"id\":";
const stdout_stream = stdout.outStream();
const stdout_stream = stdout.writer();
try stdout_stream.print("Content-Length: {}\r\n\r\n" ++ json_fmt, .{response.len + id_len + json_fmt.len - 1});
switch (id) {
.Integer => |int| try stdout_stream.print("{}", .{int}),
@ -203,7 +203,7 @@ fn publishDiagnostics(arena: *std.heap.ArenaAllocator, handle: DocumentStore.Han
var mem_buffer: [256]u8 = undefined;
var fbs = std.io.fixedBufferStream(&mem_buffer);
try tree.renderError(err, fbs.outStream());
try tree.renderError(err, fbs.writer());
try diagnostics.append(.{
.range = astLocationToRange(loc),
@ -1536,7 +1536,7 @@ pub fn main() anyerror!void {
// Init global vars
const reader = std.io.getStdIn().reader();
stdout = std.io.bufferedOutStream(std.io.getStdOut().outStream());
stdout = std.io.bufferedWriter(std.io.getStdOut().writer());
// Read the configuration, if any.
const config_parse_options = std.json.ParseOptions{ .allocator = allocator };

View File

@ -14,7 +14,7 @@ pub fn fromPath(allocator: *std.mem.Allocator, path: []const u8) ![]const u8 {
var buf = std.ArrayList(u8).init(allocator);
try buf.appendSlice(prefix);
const out_stream = buf.outStream();
const out_stream = buf.writer();
for (path) |char| {
if (char == std.fs.path.sep) {