diff options
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, }} } |
