summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-10 23:55:22 +0300
committerPaul Buetow <paul@buetow.org>2026-06-10 23:55:22 +0300
commitdd279875b978dd3539e75c4159e62cb1b78b8ce7 (patch)
treeae4fa7543311da46e00c0371ae7cc2094e29aeb4 /internal
parenta19068287901421f3112b30b5ff7b2af9e115a64 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'internal')
-rw-r--r--internal/lsp/server.go17
1 files 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) {