kkawakam / rustyline

Readline Implementation in Rust
https://crates.io/crates/rustyline/
MIT License
1.54k stars 176 forks source link

diy_hints example code doesn't work #741

Closed zahash closed 7 months ago

zahash commented 11 months ago

diy_hints example code doesn't work. Need some nicely written examples to demonstrate auto completion features instead of a hacky mess.

AnotherDaniel commented 11 months ago

More specifically, the Completer, Highlighter and Validator traits are private, according to the compiler - trying this with 12.0.0. Same here, trying to build something using Hints, but the current state of documentation/examples on this topic does make it challenging.

PR #639 seems to offer a solution to this issue... at least partially, also already has been overtaken by time it seems

gwenn commented 11 months ago

More specifically, the Completer, Highlighter and Validator traits are private, according to the compiler - trying this with 12.0.0.

https://docs.rs/rustyline/latest/rustyline/completion/trait.Completer.html

pub trait Completer {

https://docs.rs/rustyline/latest/rustyline/highlight/trait.Highlighter.html

pub trait Highlighter {

https://docs.rs/rustyline/latest/rustyline/validate/trait.Validator.html

pub trait Validator {

https://docs.rs/rustyline/latest/rustyline/derive.Completer.html

Available on crate feature derive only.

AnotherDaniel commented 10 months ago

Got it now.