Open suikabreaker opened 4 years ago
Because, when you have tokens (which may be as simple as words) or an AST, completion / suggestion / highlighting / validation become easy. So we need to send events to a lexer/parser, update Document accordingly. And fix Completer / Hinter / Highlighter API such as they have access to Document.
https://github.com/kkawakam/rustyline/issues/207#issuecomment-503204915
For one syntax, Hinter, Highlighter and Completer, Validator should/would/will be correlated. Because they should/would/will share the same Tokenizer/Parser. Currently, each one parses the same input...
It would be helpful for different components of helper, e.g. , completer and hinter, to share some information.
Completer and hinter may both take item from a candidate list.
Furthermore, they may share the intermidiate parsing result to avoid parsing input multiple times and replicating calls to parsing code.