-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Redesign Completion System #1622
Redesign Completion System #1622
Conversation
e811891
to
9c3645e
Compare
86ed365
to
5e78c64
Compare
9abd538
to
ef7850a
Compare
e282e78
to
f64f0a4
Compare
b1737ad
to
6ed101d
Compare
9f332b9
to
12e6b08
Compare
2071ff2
to
5cf7e04
Compare
daf7b52
to
2438e73
Compare
2438e73
to
5e5815b
Compare
could you review MLH-Fellowship#28 and merge it into your branch, so #1622 gets updated according to #1529 ? thanks in advance. |
Pushed what I've been working on so far. It looks like it rewrites the entire rewrite, but most of the changes are cosmetic or reorganizing, not rewriting the logic for the most part. I'll rebase this into the original commit, to keep the rewrite history useful for later. Haven't looked at the docs or changelog yet, and the failing tests are Bash not being available in those envs.
Things I noticed that I want to address:
|
2dc3348
to
0595b52
Compare
FYI, on @davidism hunch, I (in the pip installed click, version on my machine, 7.1.2) edited the file at:
And removed the line in question: Now it respects my zsh config! Separately from this PR, do you think I should submit a PR that just removes that line? |
I already got it. It was originally introduced as part of #1059, but didn't seem relevant to that, so I removed it. |
ahhh, this is so awesome! 🙏🏿🙏🏿 |
The file was renamed, and since it was also rewritten significantly git shows it as deleted (and a new file created). All the behaviors are still tested. |
@davidism |
https://github.com/pallets/click/pull/1622/files#diff-ccad5580eac2cb11fe983477ec9559daR204-R208 The longer test wasn't necessary, as they were all different ways to write the same underlying Click behavior, which is now what is represented in the test. |
@davidism thanks for making this clear.
|
2e4c8a2
to
6e0af87
Compare
Co-authored-by: Kai Chen <kaichen120@gmail.com> Co-authored-by: David Lord <davidism@gmail.com>
Co-authored-by: Amy <leiamy12@gmail.com> Co-authored-by: David Lord <davidism@gmail.com>
598f69c
to
6313dd2
Compare
Co-authored-by: Kai Chen <kaichen120@gmail.com> Co-authored-by: David Lord <davidism@gmail.com>
new function takes additional param arg, must return a homogeneous list of strings or CompletionItem, and must perform matching on results
6313dd2
to
3faede8
Compare
Resolves #1484
Resolves #780 (Files and paths)
Redesign the Completion to be more extensible:
ShellComplete
ShellComplete
viaadd_completion_class
shell_complete
function to every Click object (types, params, etc.) that takes inctx
,all_args
, andincomplete
to determine the metadata in the form(type, value, help)
dir
indicates to shells to default to their own completion system for directoriesfile
indicates to shells to default to their own completion system for filesplain
indicates to the shell to use the value of metadataSee #1622 (comment) for more changes.