erg-lang / erg

A statically typed language compatible with Python

Home Page:http://erg-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Input completion in REPL

mtshiba opened this issue · comments

Improving the usability of the REPL is an important task.
IRB (interactive ruby) etc. have implemented a feature that completes REPL input in real time, and I think Erg can do the same thing.

スクリーンショット 2024-03-18 22 01 42

Erg already has a Language Server, so the REPL can act like a language client. Alternatively, REPL can directly access the ELS API to obtain the input completion list without implementing LSP.
After that, I think we will need to implement a feature that monitors console input in real time and refreshes the screen every time the completion list is updated. I think it can be implemented using a TUI library (e.g. https://github.com/ratatui-org/ratatui) or it may be possible to implement it with crossterm, which is already a dependency of Erg.