🐛 Fix PowerShell completion with incomplete word#360
Merged
tiangolo merged 10 commits intofastapi:masterfrom Aug 24, 2024
Merged
🐛 Fix PowerShell completion with incomplete word#360tiangolo merged 10 commits intofastapi:masterfrom
tiangolo merged 10 commits intofastapi:masterfrom
Conversation
7 tasks
7 tasks
Contributor
Contributor
svlandeg
reviewed
Jul 3, 2024
Member
svlandeg
left a comment
There was a problem hiding this comment.
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_POSITIONvariable actually necessary? The buggy behaviour is still solved on my system if I remove theif cursorlines and only keep the fix of theargsdefinition - Ideally we'd have a unit test that captures this behaviour and fails on
master. I'm looking into this.
Member
|
Update:
With that, I think this is good to merge. |
Member
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.