Add hover support for in keyword (#1926)#1927
Conversation
Show contextual hover for `in` in both membership tests (displays __contains__ signature) and iteration contexts (shows iterable type).
This comment has been minimized.
This comment has been minimized.
|
Diff from mypy_primer, showing the effect of this PR on open source code: typeshed-stats (https://github.com/AlexWaygood/typeshed-stats)
- ERROR src/typeshed_stats/gather.py:999:28-1002:10: `Pattern[Unknown] | @5300 | None` is not assignable to upper bound `bytes | str` of type variable `AnyStr` [bad-specialization]
+ ERROR src/typeshed_stats/gather.py:999:28-1002:10: `Pattern[Unknown] | @7438 | None` is not assignable to upper bound `bytes | str` of type variable `AnyStr` [bad-specialization]
|
|
@grievejia has imported this pull request. If you are a Meta employee, you can view this in D89812790. |
yangdanny97
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
yangdanny97
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
This pull request has been automatically marked as stale because it has not had recent activity for more than 2 weeks. If you are still working on this this pull request, please add a comment or push new commits to keep it active. Otherwise, please unassign yourself and allow someone else to take over. Thank you for your contributions! |
yangdanny97
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
@grievejia merged this pull request in 815b977. |
Summary
inkeyword in membership tests (shows__contains__method signature)inkeyword in iteration contexts (shows iterable type)Fixes #1926
Test plan
inin membership test with custom__contains__inin for-loopsinin list comprehensions[x for x in x if x in [1]]