fix inStream/outStream removal
This commit is contained in:
parent
eefee4759c
commit
b2e456404c
@ -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", .{});
|
||||
|
||||
|
@ -64,9 +64,9 @@ pub fn collectDocComments(
|
||||
pub fn getFunctionSignature(tree: *ast.Tree, func: *ast.Node.FnProto) []const u8 {
|
||||
const start = tree.token_locs[func.firstToken()].start;
|
||||
const end = tree.token_locs[switch (func.return_type) {
|
||||
.Explicit, .InferErrorSet => |node| node.lastToken(),
|
||||
.Invalid => |r_paren| r_paren,
|
||||
}].end;
|
||||
.Explicit, .InferErrorSet => |node| node.lastToken(),
|
||||
.Invalid => |r_paren| r_paren,
|
||||
}].end;
|
||||
return tree.source[start..end];
|
||||
}
|
||||
|
||||
@ -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;
|
||||
@ -2006,7 +2006,7 @@ pub const DocumentScope = struct {
|
||||
while (decl_it.next()) |name_decl| : (idx += 1) {
|
||||
if (idx != 0) log.debug(", ", .{});
|
||||
}
|
||||
log.debug("{s}", .{name_decl.key});
|
||||
log.debug("{s}", .{name_decl.key});
|
||||
log.debug("\n--------------------------\n", .{});
|
||||
}
|
||||
}
|
||||
|
@ -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 };
|
||||
|
@ -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) {
|
||||
@ -41,7 +41,7 @@ pub fn fromPath(allocator: *std.mem.Allocator, path: []const u8) ![]const u8 {
|
||||
return buf.toOwnedSlice();
|
||||
}
|
||||
|
||||
pub const UriParseError = error {
|
||||
pub const UriParseError = error{
|
||||
UriBadScheme,
|
||||
UriBadHexChar,
|
||||
UriBadEscape,
|
||||
|
Loading…
Reference in New Issue
Block a user