diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-27 02:19:22 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-27 02:19:22 +0300 |
| commit | 51b2621d58633aa5c0f5cc7b64616d70d41acc91 (patch) | |
| tree | 0c413061a5ab8061ddeab9c3f421228737613ecb /internal/lsp/handlers.go | |
| parent | 1731126b52e406a300270c8fc8ac1061a4422b27 (diff) | |
Support multi-provider fan-out across CLI and completions
Diffstat (limited to 'internal/lsp/handlers.go')
| -rw-r--r-- | internal/lsp/handlers.go | 12 |
1 files changed, 7 insertions, 5 deletions
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, }} } |
