mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
2f152823f3
implements context-aware tab completion for mirb supporting all readline variants (GNU readline, libedit, linenoise) with graceful degradation when no readline library is available. completion features: - method names on objects (e.g., "hello".re<Tab> completes to reverse, replace) - local variables from compiler context - global variables via Ruby introspection - constants and class names - Ruby keywords architecture: - core completion engine is library-agnostic - thin adapters for readline/libedit and linenoise - context detection based on cursor position analysis - safe receiver evaluation with exception handling - proper word break characters so "String.new" works correctly implementation adds: - mirb_completion.h: interface definitions and data structures - mirb_completion.c: complete implementation (~670 lines) - mirb.c: integration with setup/cleanup calls Co-authored-by: Claude <noreply@anthropic.com>