From 36f201d5d3aaba7e0285d86cf1c0cf6b54769cff Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Thu, 10 Apr 2025 13:29:44 +0200 Subject: fix logs and add cancellation --- internal/lsp/client.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'internal/lsp/client.go') diff --git a/internal/lsp/client.go b/internal/lsp/client.go index 1b1456614..824a84b5d 100644 --- a/internal/lsp/client.go +++ b/internal/lsp/client.go @@ -18,8 +18,6 @@ import ( "github.com/kujtimiihoxha/termai/internal/lsp/protocol" ) -var logger = logging.Get() - type Client struct { Cmd *exec.Cmd stdin io.WriteCloser @@ -377,7 +375,7 @@ func (c *Client) CloseFile(ctx context.Context, filepath string) error { } if cnf.Debug { - logger.Debug("Closing file", "file", filepath) + logging.Debug("Closing file", "file", filepath) } if err := c.Notify(ctx, "textDocument/didClose", params); err != nil { return err @@ -416,12 +414,12 @@ func (c *Client) CloseAllFiles(ctx context.Context) { for _, filePath := range filesToClose { err := c.CloseFile(ctx, filePath) if err != nil && cnf.Debug { - logger.Warn("Error closing file", "file", filePath, "error", err) + logging.Warn("Error closing file", "file", filePath, "error", err) } } if cnf.Debug { - logger.Debug("Closed all files", "files", filesToClose) + logging.Debug("Closed all files", "files", filesToClose) } } -- cgit v1.2.3