summaryrefslogtreecommitdiff
path: root/internal/lsp/transport.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-17 00:06:00 +0300
committerPaul Buetow <paul@buetow.org>2025-08-17 00:06:00 +0300
commitdc383b4faef881f3bb22816f42c53a79236a4152 (patch)
tree7c6a48487fc1d51fed72ea5d15618d133132cdaa /internal/lsp/transport.go
parent6a1d48036105e92193aef11a15a77a569eeb1562 (diff)
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
Diffstat (limited to 'internal/lsp/transport.go')
-rw-r--r--internal/lsp/transport.go38
1 files changed, 19 insertions, 19 deletions
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
+ }
}