Fix completion for builtins (with subcommands)

Presently the completion engine ignores builtins that are part of the
fish syntax. This can be a problem when completing a string that was
based on the output of `commandline -p`.  This changes completions to
treat these builtins like any other command.

This also disables generic (filename) completion inside comments and
after strings that do not tokenize.

Additionally, comments are stripped off the output of `commandline -p`.

Fixes #5415
Fixes #2705
This commit is contained in:
Johannes Altmanninger
2019-10-29 13:32:26 +01:00
parent 5f99ec7eae
commit 6fb7f9b6b8
18 changed files with 248 additions and 279 deletions

View File

@@ -55,10 +55,11 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc
///
/// \param buff the string to search for subshells
/// \param cursor_pos the position of the cursor
/// \param a the start of the searched string
/// \param b the end of the searched string
/// \param a the start of the process
/// \param b the end of the process
/// \param tokens the tokens in the process
void parse_util_process_extent(const wchar_t *buff, size_t cursor_pos, const wchar_t **a,
const wchar_t **b);
const wchar_t **b, std::vector<tok_t> *tokens);
/// Find the beginning and end of the job definition under the cursor
///