File tree 1 file changed +7
-7
lines changed
src/main/kotlin/space/whitememory/pythoninlayparams
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -80,22 +80,22 @@ class PythonInlayHintsProvider : InlayParameterHintsProvider {
80
80
81
81
resolvedParameters.zip(args).forEach { (param, arg) ->
82
82
val paramName = param.name ? : return @forEach
83
+ if (arg is PyKeywordArgument || arg is PyStarArgument ) {
84
+ // Keyword arguments and unpacking don't need a hint,
85
+ // Keep for proper ordering and to avoid displaying issues
86
+ return @forEach
87
+ }
88
+
83
89
if (param is PyNamedParameter && param.isPositionalContainer) {
84
90
// This is an *args parameter that takes more than one argument
85
91
// So we stop the further processing of this call expression
86
92
inlayInfos.add(InlayInfo (" ...$paramName " , arg.textOffset))
87
93
return inlayInfos
88
94
}
89
95
90
- // The argument is unpacking, we don't want to show hints any further
91
- // Because we can't be sure what parameters it covers
92
- if (arg is PyStarArgument ) {
93
- return inlayInfos
94
- }
95
-
96
96
// Skip this parameter if its name starts with __,
97
97
// or equals to the argument provided
98
- if (arg !is PyKeywordArgument && paramName != arg.name && ! paramName.startsWith(" __" )) {
98
+ if (paramName != arg.name && ! paramName.startsWith(" __" )) {
99
99
// TODO: Add more complex filters
100
100
inlayInfos.add(InlayInfo (paramName, arg.textOffset))
101
101
}
You can’t perform that action at this time.
0 commit comments