summaryrefslogtreecommitdiff
path: root/internal/lsp/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/lsp/handlers.go')
-rw-r--r--internal/lsp/handlers.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/lsp/handlers.go b/internal/lsp/handlers.go
index 0f98715..b06b5ea 100644
--- a/internal/lsp/handlers.go
+++ b/internal/lsp/handlers.go
@@ -158,8 +158,10 @@ func (s *Server) checkTriggerFromContext(p CompletionParams, current string, ope
logging.Logf("lsp ", "handleCompletion: unmarshal raw context: %v", err)
}
} else {
- b, _ := json.Marshal(p.Context)
- if err := json.Unmarshal(b, &ctx); err != nil {
+ b, err := json.Marshal(p.Context)
+ if err != nil {
+ logging.Logf("lsp ", "handleCompletion: marshal context: %v", err)
+ } else if err := json.Unmarshal(b, &ctx); err != nil {
logging.Logf("lsp ", "handleCompletion: unmarshal context: %v", err)
}
}