-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
REPLCompletions: only complete kwargs in kwarg position #51801
REPLCompletions: only complete kwargs in kwarg position #51801
Conversation
I'm fine with limiting suggestions after a
I tend to agree that the benefits of limiting suggestions to only the most relevant cases (i.e. only Two side notes:
|
Great suggestions, thanks. Incorporated, except for
Which I couldn't immediately figure out. |
7638683
to
f1330fc
Compare
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.
Great suggestions, thanks. Incorporated, except for
we could also provide suggestions for kwargs..., including the trailing splat, if kwargs is a variable existing in scope and is a NamedTuple
Which I couldn't immediately figure out.
That's fine, it's probably not necessary and it can wait for a future PR anyway if the need arises.
@@ -1498,7 +1498,7 @@ end | |||
@test "length=" ∈ c | |||
@test "len2=" ∈ c | |||
c, r = test_complete_foo("kwtest3(1+3im; named") | |||
@test "named" ∈ c | |||
@test "named" ∉ c | |||
# TODO: @test "namedarg=" ∉ c |
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.
@Liozou is this TODO relevant? I wasn't sure what it meant
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.
Ah so this TODO is meant to be fixed by #44434, like the other TODOs introduced in #43536. It means that kwtest3(1+3im; named#TAB
currently suggests namedarg=
as a suggestion, but that's actually invalid since the method of kwtest3
that accepts the namedarg
keyword argument cannot take a Complex
as its first argument.
I made these cases TODOs instead of @test_broken
since they are wishful features really, I call them "invalid" but they are not regressions. So I believe the TODO is still relevant, but it's orthogonal to this PR.
@Liozou the example of |
Well yeah, I agree it's definitely a bit unusual, but trying to filter out callables would make the code even more confusing and difficult to maintain for very little additional gain. |
Co-Authored-By: Lionel Zoubritzky <[email protected]>
d7cafc7
to
6e37dce
Compare
Fixes #51762
This PR
After a
;
only kwargs completevalues still complete
Previously