LibLine: Unify completion hooks and adapt its users

LibLine should ultimately not care about what a "token" means in the
context of its user, so force the user to split the buffer itself.
This also allows the users to pick up contextual clues as well, since
they have to lex the line themselves.

This commit pacthes Shell and the JS repl to better handle completions,
so certain wrong behaviours are now corrected as well:
- JS repl can now complete "Object . getOw<tab>"
- Shell can now complete "echo | ca<tab>" and paths inside strings
This commit is contained in:
AnotherTest 2020-05-19 08:42:01 +04:30 committed by Andreas Kling
parent d18f6e82eb
commit 7fba21aefc
Notes: sideshowbarker 2024-07-19 06:19:59 +09:00
6 changed files with 179 additions and 171 deletions

View file

@ -112,8 +112,7 @@ public:
static ContinuationRequest is_complete(const Vector<Command>&);
void highlight(Line::Editor&) const;
Vector<Line::CompletionSuggestion> complete_first(const String&);
Vector<Line::CompletionSuggestion> complete_other(const String&);
Vector<Line::CompletionSuggestion> complete(const Line::Editor&);
String get_history_path();
void load_history();