From f91ed7ace453b3266e386ec2c2e0792b90b599b0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 24 May 2026 00:51:28 +0300 Subject: fix(repl): correct misleading comments in completer.go - completer() is not used by readline; AutoCompleteAdapter is used instead - AutoCompleteAdapter does not wrap or use the completer() function; it maintains its own commands slice - NewAutoCompleter does not use the completer function --- internal/repl/completer.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/repl/completer.go b/internal/repl/completer.go index 9c50e12..acdd79a 100644 --- a/internal/repl/completer.go +++ b/internal/repl/completer.go @@ -11,7 +11,7 @@ import ( // It returns suggestions for commands that match the current word being typed. // The matching is case-insensitive. // -// This function is used by readline for tab completion. +// The function is used in tests; readline tab completion uses AutoCompleteAdapter instead. // // text: the current word being typed // Returns a slice of strings for matching built-in commands @@ -29,12 +29,13 @@ func completer(text string) []string { return suggestions } -// AutoCompleteAdapter adapts our completer function to the readline AutoCompleter interface +// AutoCompleteAdapter implements the readline AutoCompleter interface, +// providing tab-completion suggestions for built-in commands. type AutoCompleteAdapter struct { commands []string } -// NewAutoCompleter creates a readline auto-completer that uses the completer function. +// NewAutoCompleter creates a new AutoCompleteAdapter with the current list of built-in commands. func NewAutoCompleter() *AutoCompleteAdapter { return &AutoCompleteAdapter{ commands: Commands(), -- cgit v1.2.3