refactor: output LSP client messages to log
Regular message only if lsp_output "verbose".
This commit is contained in:
parent
69ea495495
commit
21bd1e58a8
2 changed files with 16 additions and 6 deletions
|
|
@ -1562,6 +1562,13 @@ fn show_or_log_message(self: *Self, operation: enum { show, log }, params_cb: []
|
|||
self.logger_lsp.print("{s}: {s}", .{ @tagName(operation), msg });
|
||||
}
|
||||
|
||||
pub fn show_notification(self: *Self, method: []const u8, params_cb: []const u8) !void {
|
||||
if (!tp.env.get().is("lsp_verbose")) return;
|
||||
const params = try cbor.toJsonAlloc(self.allocator, params_cb);
|
||||
defer self.allocator.free(params);
|
||||
self.logger_lsp.print("LSP notification: {s} -> {s}", .{ method, params });
|
||||
}
|
||||
|
||||
pub fn register_capability(self: *Self, from: tp.pid_ref, cbor_id: []const u8, params_cb: []const u8) ClientError!void {
|
||||
_ = params_cb;
|
||||
return LSP.send_response(self.allocator, from, cbor_id, null) catch error.ClientFailed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue