feat: add config option lsp_output "quiet" to reduce LSP log verbosity

Set the option to "verbose" to re-enable logging of LSP show/logMessage requests.
This commit is contained in:
CJ van den Berg 2025-08-20 21:00:24 +02:00
parent 72423471f1
commit 69ea495495
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 18 additions and 4 deletions

View file

@ -608,10 +608,11 @@ const Process = struct {
return if (std.mem.eql(u8, method, "textDocument/publishDiagnostics"))
project.publish_diagnostics(self.parent.ref(), params_cb)
else if (std.mem.eql(u8, method, "window/showMessage"))
project.show_message(self.parent.ref(), params_cb)
project.show_message(params_cb)
else if (std.mem.eql(u8, method, "window/logMessage"))
project.show_message(self.parent.ref(), params_cb)
project.log_message(params_cb)
else {
if (!tp.env.get().is("lsp_verbose")) return;
const params = try cbor.toJsonAlloc(self.allocator, params_cb);
defer self.allocator.free(params);
self.logger.print("LSP notification: {s} -> {s}", .{ method, params });