package handler import ( "time" "git.sr.ht/~jcmuller/simple-inserts-language-server/mappers" "github.com/tliron/glsp" protocol "github.com/tliron/glsp/protocol_3_16" ) func (h *Handler) TextDocument_Completion( context *glsp.Context, params *protocol.CompletionParams, ) (any, error) { var items []protocol.CompletionItem for word, fn := range mappers.DateTimeMapper(time.Now()) { items = append(items, protocol.CompletionItem{ Label: word, Detail: ptr(fn), InsertText: ptr(fn), Kind: ptr(protocol.CompletionItemKindValue), }) } return items, nil } func ptr[T any](in T) *T { return &in }