-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab completion only works for the first command on the line #261
Labels
Comments
georgebrock
added a commit
that referenced
this issue
Mar 19, 2017
This is a really major change, and therefore a big diff. Replaces the Parslet-based parsing expression grammar (PEG) with an RLTK-based context-free grammar (CFG). The `Gitsh::Parser` (which converted text into a AST) and `Gitsh::Transformer` (which converted the AST into useful domain objects) have been replaced with a `Gitsh::Lexer` (which converts text into tokens) and `Gitsh::Parser` (which converts tokens into useful domain objects). Why? ==== Distinguishing between _invalid input_ and _valid but incomplete input_ is really hard with a PEG. There are various papers on improving PEG error reporting, and some support in Parslet for various strategies, but I couldn't find a satisfactory way to accurately work out why parsing failed without making the grammar significantly more complex. We want to add support for various multi-line constructs, which means we need to know if a line is invalid or just waiting for more input. The specific issues I have in mind are: - Support multi-line strings (#31) - Add a `:function` command for defining functions (#35) We also want to improve tab-completion in various ways, which also involves working with very similar types of incomplete input. Most of the enhancements we have in mind will only be possible if we know more exactly what we're completing, and re-using some of the parsing code to understand the input seemed like the most logical approach. Specific issues are: - Support the same tab completion options as zsh (#25) - Add tab completion for options (#80) - Auto complete stash commands (#220) - Tab completion only works for the first command on the line (#261) Note that this commit doesn't implement any of these enhancements, it just makes them more likely to happen in the future. Implementation details ====================== - Introduces equality methods on argument objects, used to testing parser output. - git-prefix correction (i.e. interpreting `git foo` as `foo` when `help.autocorrect` is set) has moved from the Parser to the GitCommand class. - The subshell implementation in this commit is not very good. It will be significantly improved in the next couple of commits, but it seemed too big of a change to roll into this one.
georgebrock
added a commit
that referenced
this issue
Apr 1, 2017
This is a really major change, and therefore a big diff. Replaces the Parslet-based parsing expression grammar (PEG) with an RLTK-based context-free grammar (CFG). The `Gitsh::Parser` (which converted text into a AST) and `Gitsh::Transformer` (which converted the AST into useful domain objects) have been replaced with a `Gitsh::Lexer` (which converts text into tokens) and `Gitsh::Parser` (which converts tokens into useful domain objects). Why? ==== Distinguishing between _invalid input_ and _valid but incomplete input_ is really hard with a PEG. There are various papers on improving PEG error reporting, and some support in Parslet for various strategies, but I couldn't find a satisfactory way to accurately work out why parsing failed without making the grammar significantly more complex. We want to add support for various multi-line constructs, which means we need to know if a line is invalid or just waiting for more input. The specific issues I have in mind are: - Support multi-line strings (#31) - Add a `:function` command for defining functions (#35) We also want to improve tab-completion in various ways, which also involves working with very similar types of incomplete input. Most of the enhancements we have in mind will only be possible if we know more exactly what we're completing, and re-using some of the parsing code to understand the input seemed like the most logical approach. Specific issues are: - Support the same tab completion options as zsh (#25) - Add tab completion for options (#80) - Auto complete stash commands (#220) - Tab completion only works for the first command on the line (#261) Note that this commit doesn't implement any of these enhancements, it just makes them more likely to happen in the future. Implementation details ====================== - Introduces equality methods on argument objects, used to testing parser output. - git-prefix correction (i.e. interpreting `git foo` as `foo` when `help.autocorrect` is set) has moved from the Parser to the GitCommand class. - The subshell implementation in this commit is not very good. It will be significantly improved in the next couple of commits, but it seemed too big of a change to roll into this one.
georgebrock
added a commit
that referenced
this issue
Apr 8, 2017
This is a really major change, and therefore a big diff. Replaces the Parslet-based parsing expression grammar (PEG) with an RLTK-based context-free grammar (CFG). The `Gitsh::Parser` (which converted text into a AST) and `Gitsh::Transformer` (which converted the AST into useful domain objects) have been replaced with a `Gitsh::Lexer` (which converts text into tokens) and `Gitsh::Parser` (which converts tokens into useful domain objects). Why? ==== Distinguishing between _invalid input_ and _valid but incomplete input_ is really hard with a PEG. There are various papers on improving PEG error reporting, and some support in Parslet for various strategies, but I couldn't find a satisfactory way to accurately work out why parsing failed without making the grammar significantly more complex. We want to add support for various multi-line constructs, which means we need to know if a line is invalid or just waiting for more input. The specific issues I have in mind are: - Support multi-line strings (#31) - Add a `:function` command for defining functions (#35) We also want to improve tab-completion in various ways, which also involves working with very similar types of incomplete input. Most of the enhancements we have in mind will only be possible if we know more exactly what we're completing, and re-using some of the parsing code to understand the input seemed like the most logical approach. Specific issues are: - Support the same tab completion options as zsh (#25) - Add tab completion for options (#80) - Auto complete stash commands (#220) - Tab completion only works for the first command on the line (#261) Note that this commit doesn't implement any of these enhancements, it just makes them more likely to happen in the future. Implementation details ====================== - Introduces equality methods on argument objects, used to testing parser output. - git-prefix correction (i.e. interpreting `git foo` as `foo` when `help.autocorrect` is set) has moved from the Parser to the GitCommand class. - The subshell implementation in this commit is not very good. It will be significantly improved in the next couple of commits, but it seemed too big of a change to roll into this one.
georgebrock
added a commit
that referenced
this issue
Apr 19, 2017
This is a really major change, and therefore a big diff. Replaces the Parslet-based parsing expression grammar (PEG) with an RLTK-based context-free grammar (CFG). The `Gitsh::Parser` (which converted text into a AST) and `Gitsh::Transformer` (which converted the AST into useful domain objects) have been replaced with a `Gitsh::Lexer` (which converts text into tokens) and `Gitsh::Parser` (which converts tokens into useful domain objects). Why? ==== Distinguishing between _invalid input_ and _valid but incomplete input_ is really hard with a PEG. There are various papers on improving PEG error reporting, and some support in Parslet for various strategies, but I couldn't find a satisfactory way to accurately work out why parsing failed without making the grammar significantly more complex. We want to add support for various multi-line constructs, which means we need to know if a line is invalid or just waiting for more input. The specific issues I have in mind are: - Support multi-line strings (#31) - Add a `:function` command for defining functions (#35) We also want to improve tab-completion in various ways, which also involves working with very similar types of incomplete input. Most of the enhancements we have in mind will only be possible if we know more exactly what we're completing, and re-using some of the parsing code to understand the input seemed like the most logical approach. Specific issues are: - Support the same tab completion options as zsh (#25) - Add tab completion for options (#80) - Auto complete stash commands (#220) - Tab completion only works for the first command on the line (#261) Note that this commit doesn't implement any of these enhancements, it just makes them more likely to happen in the future. Implementation details ====================== - Introduces equality methods on argument objects, used to testing parser output. - git-prefix correction (i.e. interpreting `git foo` as `foo` when `help.autocorrect` is set) has moved from the Parser to the GitCommand class. - The subshell implementation in this commit is not very good. It will be significantly improved in the next couple of commits, but it seemed too big of a change to roll into this one.
georgebrock
added a commit
that referenced
this issue
Apr 19, 2017
This is a really major change, and therefore a big diff. Replaces the Parslet-based parsing expression grammar (PEG) with an RLTK-based context-free grammar (CFG). The `Gitsh::Parser` (which converted text into a AST) and `Gitsh::Transformer` (which converted the AST into useful domain objects) have been replaced with a `Gitsh::Lexer` (which converts text into tokens) and `Gitsh::Parser` (which converts tokens into useful domain objects). Why? ==== Distinguishing between _invalid input_ and _valid but incomplete input_ is really hard with a PEG. There are various papers on improving PEG error reporting, and some support in Parslet for various strategies, but I couldn't find a satisfactory way to accurately work out why parsing failed without making the grammar significantly more complex. We want to add support for various multi-line constructs, which means we need to know if a line is invalid or just waiting for more input. The specific issues I have in mind are: - Support multi-line strings (#31) - Add a `:function` command for defining functions (#35) We also want to improve tab-completion in various ways, which also involves working with very similar types of incomplete input. Most of the enhancements we have in mind will only be possible if we know more exactly what we're completing, and re-using some of the parsing code to understand the input seemed like the most logical approach. Specific issues are: - Support the same tab completion options as zsh (#25) - Add tab completion for options (#80) - Auto complete stash commands (#220) - Tab completion only works for the first command on the line (#261) Note that this commit doesn't implement any of these enhancements, it just makes them more likely to happen in the future. Implementation details ====================== - Introduces equality methods on argument objects, used to testing parser output. - git-prefix correction (i.e. interpreting `git foo` as `foo` when `help.autocorrect` is set) has moved from the Parser to the GitCommand class. - The subshell implementation in this commit is not very good. It will be significantly improved in the next couple of commits, but it seemed too big of a change to roll into this one.
Closing in favour of #296. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's possible to tab complete the first command on a line, e.g. adtab will complete to add .
It's not possible to complete subsequent commands, e.g. add thing.txt && commtab won't complete to add thing.txt && commit , but it might complete to something else if
com
matches the name of a file, remote, or branch.This is because command completion or argument completion is selected based on the naive assumption that if any spaces appear before the thing we're completing, it must be an argument.
The text was updated successfully, but these errors were encountered: