refactor: remove obsolete lsp_request_timeout config parameter

This commit is contained in:
CJ van den Berg 2025-03-25 20:56:28 +01:00
parent aa568dfd5e
commit f6847001db
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 2 additions and 7 deletions

View file

@ -41,8 +41,7 @@ pub fn send_request(
var cb = std.ArrayList(u8).init(self.allocator); var cb = std.ArrayList(u8).init(self.allocator);
defer cb.deinit(); defer cb.deinit();
try cbor.writeValue(cb.writer(), m); try cbor.writeValue(cb.writer(), m);
const request_timeout: u64 = @intCast(std.time.ns_per_s * tp.env.get().num("lsp-request-timeout")); return RequestContext(@TypeOf(ctx)).send(allocator, self.pid.ref(), ctx, tp.message.fmt(.{ "REQ", method, cb.items }));
return RequestContext(@TypeOf(ctx)).send(allocator, self.pid.ref(), ctx, request_timeout, tp.message.fmt(.{ "REQ", method, cb.items }));
} }
pub fn send_notification(self: Self, method: []const u8, m: anytype) (OutOfMemoryError || SendError)!void { pub fn send_notification(self: Self, method: []const u8, m: anytype) (OutOfMemoryError || SendError)!void {
@ -72,8 +71,7 @@ fn RequestContext(T: type) type {
const Self = @This(); const Self = @This();
const ReceiverT = tp.Receiver(*@This()); const ReceiverT = tp.Receiver(*@This());
fn send(a: std.mem.Allocator, to: tp.pid_ref, ctx: T, timeout_ns: u64, request: tp.message) (OutOfMemoryError || SpawnError)!void { fn send(a: std.mem.Allocator, to: tp.pid_ref, ctx: T, request: tp.message) (OutOfMemoryError || SpawnError)!void {
_ = timeout_ns;
const self = try a.create(@This()); const self = try a.create(@This());
self.* = .{ self.* = .{
.receiver = undefined, .receiver = undefined,

View file

@ -25,8 +25,6 @@ bottom_bar: []const u8 = "mode file log selection diagnostics keybind linenumber
show_scrollbars: bool = true, show_scrollbars: bool = true,
show_fileicons: bool = true, show_fileicons: bool = true,
lsp_request_timeout: usize = 10,
include_files: []const u8 = "", include_files: []const u8 = "",
pub const DigitStyle = enum { pub const DigitStyle = enum {

View file

@ -114,7 +114,6 @@ fn init(allocator: Allocator) InitError!*Self {
if (frame_rate != 0) if (frame_rate != 0)
conf.frame_rate = frame_rate; conf.frame_rate = frame_rate;
tp.env.get().num_set("frame-rate", @intCast(conf.frame_rate)); tp.env.get().num_set("frame-rate", @intCast(conf.frame_rate));
tp.env.get().num_set("lsp-request-timeout", @intCast(conf.lsp_request_timeout));
const frame_time = std.time.us_per_s / conf.frame_rate; const frame_time = std.time.us_per_s / conf.frame_rate;
const frame_clock = try tp.metronome.init(frame_time); const frame_clock = try tp.metronome.init(frame_time);