build: update thespian to use separate cbor package
This commit is contained in:
parent
6eaef79f43
commit
c3cda5b7fe
6 changed files with 33 additions and 6 deletions
|
@ -225,7 +225,12 @@ pub fn build_exe(
|
|||
});
|
||||
|
||||
const thespian_mod = thespian_dep.module("thespian");
|
||||
const cbor_mod = thespian_dep.module("cbor");
|
||||
|
||||
const cbor_dep = thespian_dep.builder.dependency("cbor", .{
|
||||
.target = target,
|
||||
.optimize = optimize_deps,
|
||||
});
|
||||
const cbor_mod = cbor_dep.module("cbor");
|
||||
|
||||
const tracy_dep = if (tracy_enabled) thespian_dep.builder.dependency("tracy", .{
|
||||
.target = target,
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
.hash = "dizzy-1.0.0-AAAAAM1wAAAiDbx_6RwcVEOBk8p2XOu8t9WPNc3K7kBK",
|
||||
},
|
||||
.thespian = .{
|
||||
.url = "https://github.com/neurocyte/thespian/archive/e3921691dc5d949ee38719251d67841f88dbabfd.tar.gz",
|
||||
.hash = "thespian-0.0.1-owFOjsnnBgDTBCdPHQhp3Ir3hLZI5pVLOrlIa8JtGJAb",
|
||||
.url = "https://github.com/neurocyte/thespian/archive/42a98a44e7590fd6e952b75523e5c0f4fa0e6c97.tar.gz",
|
||||
.hash = "thespian-0.0.1-owFOjnUTBgBUlBtQ-SbN_6S7bXE6e2mKmCgk4A-RGBMA",
|
||||
},
|
||||
.themes = .{
|
||||
.url = "https://github.com/neurocyte/flow-themes/releases/download/master-59bf204551bcb238faddd06779063570e7e6d431/flow-themes.tar.gz",
|
||||
|
|
|
@ -227,6 +227,7 @@ const Process = struct {
|
|||
UnsupportedType,
|
||||
ExitNormal,
|
||||
ExitUnexpected,
|
||||
InvalidMapType,
|
||||
});
|
||||
|
||||
fn receive_safe(self: *Process, from: tp.pid_ref, m: tp.message) Error!void {
|
||||
|
|
|
@ -26,7 +26,7 @@ const Self = @This();
|
|||
|
||||
const OutOfMemoryError = error{OutOfMemory};
|
||||
const SpawnError = (OutOfMemoryError || error{ThespianSpawnFailed});
|
||||
pub const InvalidMessageError = error{ InvalidMessage, InvalidMessageField, InvalidTargetURI };
|
||||
pub const InvalidMessageError = error{ InvalidMessage, InvalidMessageField, InvalidTargetURI, InvalidMapType };
|
||||
pub const StartLspError = (error{ ThespianSpawnFailed, Timeout, InvalidLspCommand } || LspError || OutOfMemoryError || cbor.Error);
|
||||
pub const LspError = (error{ NoLsp, LspFailed } || OutOfMemoryError);
|
||||
pub const ClientError = (error{ClientFailed} || OutOfMemoryError);
|
||||
|
@ -131,7 +131,7 @@ pub fn restore_state(self: *Self, data: []const u8) !void {
|
|||
var iter: []const u8 = data;
|
||||
_ = cbor.matchValue(&iter, tp.string) catch {};
|
||||
_ = cbor.decodeArrayHeader(&iter) catch |e| switch (e) {
|
||||
error.InvalidType => return self.restore_state_v0(data),
|
||||
error.InvalidArrayType => return self.restore_state_v0(data),
|
||||
else => return tp.trace(tp.channel.debug, .{ "restore_state", "unknown format", data }),
|
||||
};
|
||||
self.persistent = true;
|
||||
|
@ -191,7 +191,18 @@ pub fn restore_state_v1(self: *Self, data: []const u8) !void {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn restore_state_v0(self: *Self, data: []const u8) error{ OutOfMemory, IntegerTooLarge, IntegerTooSmall, InvalidType, TooShort }!void {
|
||||
pub fn restore_state_v0(self: *Self, data: []const u8) error{
|
||||
OutOfMemory,
|
||||
IntegerTooLarge,
|
||||
IntegerTooSmall,
|
||||
InvalidType,
|
||||
TooShort,
|
||||
InvalidFloatType,
|
||||
InvalidArrayType,
|
||||
InvalidPIntType,
|
||||
JsonIncompatibleType,
|
||||
NotAnObject,
|
||||
}!void {
|
||||
tp.trace(tp.channel.debug, .{"restore_state_v0"});
|
||||
defer self.sort_files_by_mtime();
|
||||
var name: []const u8 = undefined;
|
||||
|
|
|
@ -52,6 +52,11 @@ pub const Error = error{
|
|||
CodepointTooLarge,
|
||||
TtyInitError,
|
||||
TtyWriteError,
|
||||
InvalidFloatType,
|
||||
InvalidArrayType,
|
||||
InvalidPIntType,
|
||||
JsonIncompatibleType,
|
||||
NotAnObject,
|
||||
} || std.Thread.SpawnError;
|
||||
|
||||
pub fn init(allocator: std.mem.Allocator, handler_ctx: *anyopaque, no_alternate: bool, _: *const fn (ctx: *anyopaque) void) Error!Self {
|
||||
|
|
|
@ -21,6 +21,11 @@ pub const Error = error{
|
|||
IntegerTooSmall,
|
||||
InvalidType,
|
||||
TooShort,
|
||||
InvalidFloatType,
|
||||
InvalidArrayType,
|
||||
InvalidPIntType,
|
||||
JsonIncompatibleType,
|
||||
NotAnObject,
|
||||
};
|
||||
|
||||
pub const OutputHandler = fn (context: usize, parent: tp.pid_ref, arg0: []const u8, output: []const u8) void;
|
||||
|
|
Loading…
Add table
Reference in a new issue