Comments (9)
This only adds autocompletion for alias itsef
@albfan, yep, i did get sorted. I think it's possible to get completions for aliased commands by making aliases
function returning parsers from git_parser
, This would allow to not restructure the whole git_parser
as this would be very massive change. I'll take a look at this approach in the mean time
from clink-completions.
This only adds autocompletion for alias itsef.
But the fix is easy, just need some boilerplate code. The match from alias an real command should be keeped, and the parser should be added to aliases based on its real command.
https://github.com/vladimir-kotikov/clink-completions/blob/master/git.lua#L480
on that line you have the parser for checkout autocomplete. You need to add that autocompletion con co
alias so my thoughs is you need to create a table:
parsers = {}
parsers["checkout"] = parser({checkout_spec_generator},
"-q", "--quiet", "-q", "--quiet",
"-b", "-b",
"-B", "-B",
"-l", "-l",
"--detach", "--detach",
"-t", "--track", "-t", "--track",
"--orphan", "--orphan",
"-2", "--ours", "-2", "--ours",
"-3", "--theirs", "-3", "--theirs",
"-f", "--force", "-f", "--force",
"-m", "--merge", "-m", "--merge",
"--overwrite-ignore", "--overwrite-ignore",
"--conflict", "--conflict",
"-p", "--patch", "-p", "--patch",
"--ignore-skip-worktree-bits" "--ignore-skip-worktree-bits"
)
and use it later on alias and real commands
https://github.com/vladimir-kotikov/clink-completions/blob/master/git.lua#L115
here line variable have both alias and real command, that need to be keeped
https://github.com/vladimir-kotikov/clink-completions/blob/master/git.lua#L119
here search on parsers table and see if you have avaliable some parser for real command under co (checkout)
from clink-completions.
This function does not work in my box. :(
C:\Users\lijunle\Repos\test>git config --get-regexp alias 2>nul
alias.st status -sb
alias.ci commit
alias.br branch
alias.co checkout
alias.ft fetch -p
alias.cp cherry-pick
Command git checkout m<TAB>
getting the right branch, however, git co m<TAB>
does not work.
from clink-completions.
@lijunle, thanks for report. i'll investigate
from clink-completions.
As a workaround or short-term solution, Is there a way users can add their own aliases to the git_parser, without modifying git.lua directly? I'm not that familiar with the clink api, so wondering if I could do something along the lines of write my own lua file that gets the current git_parser and adds additional commands?
from clink-completions.
Hello,
Is there any news about this enhancement ? :)
from clink-completions.
@vladimir-kotikov are you still get involved in this project ?
As you seemed to say, the issue does not look so hard to fix, could we have some hope that it will be fixed soon ? ^_^
from clink-completions.
My relation with windows involves using msys2 and not reinvent the wheel.
from clink-completions.
@albfan , you make my day !
I used this link in order to use msys2 with cmder and git bash completion works perfectly, many thanks !
from clink-completions.
Related Issues (20)
- Unwanted behaviour for `adb` and `scrcpy` completions. HOT 6
- git.lua:155: attempt to call upvalue 'w' (a nil value) HOT 8
- Run git pull on script folders after update HOT 3
- Error when completing ssh HOT 3
- Improve winget completion HOT 9
- openssl.lua:1179: attempt to compare number with string HOT 1
- Error "module 'path' not found" on fresh install. HOT 8
- Sudo Clink version mismatch HOT 6
- Winget completion throws error HOT 8
- Completion for Nuke.Build HOT 12
- git add completions are git root relative instead of cwd relative HOT 2
- Git add tries to add already added (renamed/moved) file HOT 2
- RFE: add completions for ping HOT 10
- Bug: completions from known_hosts for ssh and ping on non-default port HOT 5
- The new git_prompt.lua in 0.4.9 breaks custom non-cmder prompt HOT 6
- Add completions for arduino-cli HOT 1
- How to let 'git add' completion non-recursive HOT 7
- Add completions for go and rust tools
- Test error HOT 7
- Update docs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clink-completions.