Skip to content
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

Auto complete stash commands #220

Closed
lode opened this issue Jan 20, 2015 · 1 comment
Closed

Auto complete stash commands #220

lode opened this issue Jan 20, 2015 · 1 comment
Assignees

Comments

@lode
Copy link

lode commented Jan 20, 2015

I miss auto completion for stash commands.

Mainly the stash names stash@{0} when typing stash show -p + tab I would like it to expand to stash show -p stash@{ and to show me a list of stashes.

But also the main commands would be nice, like stash a + tab => stash apply.

Right now branch names and directories are auto completed and shown on multiple choices. I don't know about other people, but I hardly use those functionality with stash.

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.
@georgebrock georgebrock self-assigned this Jul 3, 2017
@georgebrock
Copy link
Collaborator

After the tab completion improvements introduced in #296, #304, #310, #311, #312, #313, we can now tab complete stash commands (and other popular commands with sub-commands!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants