[ty] Avoid showing misleading hint for unpacked tuple arguments (#22286)

## Summary

We could implement support for showing multiple argument names, though
this seems to match PyCharm.

Closes https://github.com/astral-sh/ty/issues/2250.
This commit is contained in:
Charlie Marsh
2025-12-29 13:25:08 -05:00
committed by GitHub
parent ebc1323ccb
commit 3d8ae2e476
2 changed files with 110 additions and 0 deletions

View File

@@ -788,6 +788,12 @@ pub fn inlay_hint_call_argument_details<'db>(
continue;
}
// Skip if this argument maps to multiple parameters (e.g., unpacked tuple filling
// multiple slots). Showing a single parameter name would be misleading.
if arg_mapping.parameters.len() > 1 {
continue;
}
let Some(param_index) = arg_mapping.parameters.first() else {
continue;
};