From dd279875b978dd3539e75c4159e62cb1b78b8ce7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 10 Jun 2026 23:55:22 +0300 Subject: lsp: rename 'close' return to 'closeStr' in inlineMarkers to avoid shadowing builtin The named return value 'close' in Server.inlineMarkers() shadowed the Go builtin 'close'. Renamed it to 'closeStr' (matching the 'openStr' naming used by callers) and added a comment explaining the reasoning. Callers use positional returns, so no call sites changed. Co-Authored-By: Claude Opus 4.8 --- internal/lsp/server.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/internal/lsp/server.go b/internal/lsp/server.go index 7675d34..5fae78a 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -273,25 +273,28 @@ func (s *Server) completionWaitAll() bool { return *cfg.CompletionWaitAll } -func (s *Server) inlineMarkers() (open string, close string, openChar byte, closeChar byte) { +// inlineMarkers returns the configured inline open/close marker strings along +// with their leading bytes. The close marker is named closeStr rather than +// close so it does not shadow the Go builtin close used for channels. +func (s *Server) inlineMarkers() (open string, closeStr string, openChar byte, closeChar byte) { cfg := s.currentConfig() open = strings.TrimSpace(cfg.InlineOpen) if open == "" { open = ">!" } - close = strings.TrimSpace(cfg.InlineClose) - if close == "" { - close = ">" + closeStr = strings.TrimSpace(cfg.InlineClose) + if closeStr == "" { + closeStr = ">" } openChar = '>' if len(open) > 0 { openChar = open[0] } closeChar = '>' - if len(close) > 0 { - closeChar = close[0] + if len(closeStr) > 0 { + closeChar = closeStr[0] } - return open, close, openChar, closeChar + return open, closeStr, openChar, closeChar } func (s *Server) chatConfig() (suffix string, prefixes []string, suffixChar byte) { -- cgit v1.2.3