From dc383b4faef881f3bb22816f42c53a79236a4152 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 17 Aug 2025 00:06:00 +0300 Subject: lsp/config: make completion trigger characters configurable - Add trigger_characters to JSON config and ServerOptions - Store on server and advertise in initialize - Update README and example config - Preserve previous defaults when unset --- internal/lsp/transport.go | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'internal/lsp/transport.go') diff --git a/internal/lsp/transport.go b/internal/lsp/transport.go index dfdb5fc..4d352f8 100644 --- a/internal/lsp/transport.go +++ b/internal/lsp/transport.go @@ -1,13 +1,13 @@ package lsp import ( - "encoding/json" - "fmt" - "hexai/internal/logging" - "io" - "net/textproto" - "strconv" - "strings" + "encoding/json" + "fmt" + "hexai/internal/logging" + "io" + "net/textproto" + "strconv" + "strings" ) func (s *Server) readMessage() ([]byte, error) { @@ -48,17 +48,17 @@ func (s *Server) readMessage() ([]byte, error) { func (s *Server) writeMessage(v any) { data, err := json.Marshal(v) - if err != nil { - logging.Logf("lsp ", "marshal error: %v", err) - return - } + if err != nil { + logging.Logf("lsp ", "marshal error: %v", err) + return + } header := fmt.Sprintf("Content-Length: %d\r\n\r\n", len(data)) - if _, err := io.WriteString(s.out, header); err != nil { - logging.Logf("lsp ", "write header error: %v", err) - return - } - if _, err := s.out.Write(data); err != nil { - logging.Logf("lsp ", "write body error: %v", err) - return - } + if _, err := io.WriteString(s.out, header); err != nil { + logging.Logf("lsp ", "write header error: %v", err) + return + } + if _, err := s.out.Write(data); err != nil { + logging.Logf("lsp ", "write body error: %v", err) + return + } } -- cgit v1.2.3