-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
🐛 Fix PowerShell completion with incomplete word #360
Conversation
📝 Docs preview for commit 148e1b2 at: https://639cea8c57a0d303631b5efc--typertiangolo.netlify.app |
📝 Docs preview for commit 4e8ff9d at: https://647d42deaf2e9e11716f1c45--typertiangolo.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the bug with Powershell: there are no auto-completion suggestions when typing "Ca" or "Se" on master
. This PR resolves the issue.
Two points I'd like to address/look into before we could merge this PR:
- Is the
_TYPER_CURSOR_POSITION
variable actually necessary? The buggy behaviour is still solved on my system if I remove theif cursor
lines and only keep the fix of theargs
definition - Ideally we'd have a unit test that captures this behaviour and fails on
master
. I'm looking into this.
Update:
With that, I think this is good to merge. |
Great, thank you for the contribution (and the patience) @patricksurry! 🍰 And thank you @svlandeg for the thorough review, tweaks, and help. 🙇 ☕ This will be available in Typer |
Fixes #359
Standard example in documentation failed because incomplete word was not removed from cwords, so typer thought we were adding an additional parameter which wouldn't be allowed. Completing on a
List[]
parameter appeared to work because then a subsequent parameter would be allowed.Also handles the case where we are completing somewhere other than the end of the line, by ignoring text past the cursor position and then completing normally.