fix hover on named parameter is missing info #3238#4054
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks @asukaminato0721 ! The new hover_shows_type_for_imported_keyword_argument test and the kwarg_with_overload improvement (None → int) are great. One blocker before this can land. The keyword-argument hover resolution in state/lsp.rs was refactored on main since you branched, it now goes through classify_surface → keyword_argument_key → ResolutionKind rather than the direct find_definition_for_keyword_argument().first().and_then(...) match arm this patch edits, so the main hunk no longer applies. Could you rebase onto latest main and re-express the fix on the new structure? Also: keyword_argument_key is where the definition Key should be resolved against the defining module's handle, and the call-signature fallback can hang off the KeywordArgument handling. The get_expected_type_at → get_active_call_argument_type_for_surface extraction still applies cleanly and is a nice cleanup to keep. |
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Summary
Fixes #3238
Now keyword-argument hover can resolve parameter types from the defining module, not just the caller module,
fall back to the selected call signature when definition refinement is unavailable.
Test Plan
add a test && update a todo