From 51b2621d58633aa5c0f5cc7b64616d70d41acc91 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 27 Sep 2025 02:19:22 +0300 Subject: Support multi-provider fan-out across CLI and completions --- internal/lsp/handlers.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'internal/lsp/handlers.go') diff --git a/internal/lsp/handlers.go b/internal/lsp/handlers.go index c1a637f..94b6348 100644 --- a/internal/lsp/handlers.go +++ b/internal/lsp/handlers.go @@ -343,13 +343,15 @@ func (s *Server) isTriggerEvent(p CompletionParams, current string) bool { return false } -func (s *Server) makeCompletionItems(cleaned string, inParams bool, current string, p CompletionParams, docStr string) []CompletionItem { +func (s *Server) makeCompletionItems(cleaned string, inParams bool, current string, p CompletionParams, docStr string, detail string, sortPrefix string) []CompletionItem { te, filter := computeTextEditAndFilter(cleaned, inParams, current, p) rm := s.collectPromptRemovalEdits(p.TextDocument.URI) label := labelForCompletion(cleaned, filter) - detail := "Hexai LLM completion" - if client := s.currentLLMClient(); client != nil { - detail = "Hexai " + client.Name() + ":" + client.DefaultModel() + if strings.TrimSpace(detail) == "" { + detail = "Hexai LLM completion" + } + if sortPrefix == "" { + sortPrefix = "0000" } return []CompletionItem{{ Label: label, @@ -359,7 +361,7 @@ func (s *Server) makeCompletionItems(cleaned string, inParams bool, current stri FilterText: strings.TrimLeft(filter, " \t"), TextEdit: te, AdditionalTextEdits: rm, - SortText: "0000", + SortText: sortPrefix, Documentation: docStr, }} } -- cgit v1.2.3