summaryrefslogtreecommitdiffhomepage
path: root/internal/lsp/client.go
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-10 13:29:44 +0200
committerKujtim Hoxha <[email protected]>2025-04-10 13:29:44 +0200
commit36f201d5d3aaba7e0285d86cf1c0cf6b54769cff (patch)
tree1f1c99e66df4c25f816fbfba2b1e255c94bec9ba /internal/lsp/client.go
parent0b007b9c77bc790127021a7e03c8e05ec8e5e081 (diff)
downloadopencode-36f201d5d3aaba7e0285d86cf1c0cf6b54769cff.tar.gz
opencode-36f201d5d3aaba7e0285d86cf1c0cf6b54769cff.zip
fix logs and add cancellation
Diffstat (limited to 'internal/lsp/client.go')
-rw-r--r--internal/lsp/client.go8
1 files changed, 3 insertions, 5 deletions
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)
}
}