mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
Shell: Implement program-aware autocompletion
A program can either respond to `--complete -- some args to complete` directly, or add a `_complete_<program name>` invokable (i.e. shell function, or just a plain binary in PATH) that completes the given command and lists the completions on stdout. Should such a completion fail or yield no results, we'll fall back to the previous completion algorithm.
This commit is contained in:
parent
fc4d36ccd0
commit
7e4cc187d9
5 changed files with 315 additions and 47 deletions
|
@ -186,13 +186,15 @@ public:
|
|||
|
||||
void highlight(Line::Editor&) const;
|
||||
Vector<Line::CompletionSuggestion> complete();
|
||||
Vector<Line::CompletionSuggestion> complete_path(StringView base, StringView, size_t offset, ExecutableOnly executable_only, EscapeMode = EscapeMode::Bareword);
|
||||
Vector<Line::CompletionSuggestion> complete_program_name(StringView, size_t offset, EscapeMode = EscapeMode::Bareword);
|
||||
Vector<Line::CompletionSuggestion> complete_variable(StringView, size_t offset);
|
||||
Vector<Line::CompletionSuggestion> complete_user(StringView, size_t offset);
|
||||
Vector<Line::CompletionSuggestion> complete_option(StringView, StringView, size_t offset);
|
||||
Vector<Line::CompletionSuggestion> complete_immediate_function_name(StringView, size_t offset);
|
||||
|
||||
Vector<Line::CompletionSuggestion> complete_path(StringView base, StringView, size_t offset, ExecutableOnly executable_only, AST::Node const* command_node, AST::Node const*, EscapeMode = EscapeMode::Bareword);
|
||||
Vector<Line::CompletionSuggestion> complete_option(StringView, StringView, size_t offset, AST::Node const* command_node, AST::Node const*);
|
||||
ErrorOr<Vector<Line::CompletionSuggestion>> complete_via_program_itself(size_t offset, AST::Node const* command_node, AST::Node const*, EscapeMode escape_mode, StringView known_program_name);
|
||||
|
||||
void restore_ios();
|
||||
|
||||
u64 find_last_job_id() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue