Skip to content

Commit c89367c

Browse files
committed
Always show a hint for *args
1 parent 58654d3 commit c89367c

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## [Unreleased]
44
### Changed
55
- Hide the hints that are 1 character long
6-
- Don't show hints in call expressions that take a single parameter
6+
- Don't show hints in call expressions that take a single parameter (except for `*args`)
77

88
### Fixed
99
- Hints showing when placing a positional argument after keyword ones

src/main/kotlin/space/whitememory/pythoninlayparams/PythonInlayHintsProvider.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ class PythonInlayHintsProvider : InlayParameterHintsProvider {
7575
}
7676

7777
if (finalParameters.size == 1) {
78-
// Don't need a hint if there's only one parameter
79-
return inlayInfos
78+
// Don't need a hint if there's only one parameter,
79+
// Make an exception for *args
80+
finalParameters[0].let {
81+
if (it !is PyNamedParameter || !it.isPositionalContainer) return inlayInfos
82+
}
8083
}
8184

8285
finalParameters.zip(element.arguments).forEach { (param, arg) ->

0 commit comments

Comments
 (0)