diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-19 22:52:48 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-19 22:52:48 +0300 |
| commit | eb72b06fe8e62cb77af73f6dc558d384a5a5fe80 (patch) | |
| tree | efeb1165b9fbcb69a4ee675dba7bdc8c28fee3aa /internal/lsp/server.go | |
| parent | acc400768153a7bfda1413f15579c9455b877c87 (diff) | |
fix
Diffstat (limited to 'internal/lsp/server.go')
| -rw-r--r-- | internal/lsp/server.go | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/internal/lsp/server.go b/internal/lsp/server.go index e3728c8..13066f7 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -18,6 +18,7 @@ import ( type Server struct { in *bufio.Reader out io.Writer + outMu sync.Mutex logger *log.Logger exited bool mu sync.RWMutex @@ -55,10 +56,13 @@ type Server struct { handlers map[string]func(Request) // Configurable trigger characters - inlineOpen string - inlineClose string - chatSuffix string - chatPrefixes []string + inlineOpen string + inlineClose string + chatSuffix string + chatPrefixes []string + inlineOpenChar byte + inlineCloseChar byte + chatSuffixChar byte // Prompt templates // Completion @@ -230,18 +234,20 @@ func NewServer(r io.Reader, w io.Writer, logger *log.Logger, opts ServerOptions) s.customActions = append([]CustomAction{}, opts.CustomActions...) } - // Assign package-level inline trigger chars for free helper functions if s.inlineOpen != "" { - inlineOpenChar = s.inlineOpen[0] + s.inlineOpenChar = s.inlineOpen[0] + } else { + s.inlineOpenChar = '>' } if s.inlineClose != "" { - inlineCloseChar = s.inlineClose[0] + s.inlineCloseChar = s.inlineClose[0] + } else { + s.inlineCloseChar = '>' } if s.chatSuffix != "" { - chatSuffixChar = s.chatSuffix[0] - } - if len(s.chatPrefixes) > 0 { - chatPrefixSingles = append([]string{}, s.chatPrefixes...) + s.chatSuffixChar = s.chatSuffix[0] + } else { + s.chatSuffixChar = '>' } // Initialize dispatch table s.handlers = map[string]func(Request){ |
