@@ -41,6 +41,7 @@ class PythonInlayHintsProvider : InlayParameterHintsProvider {
4141
4242 // Handle lambda expression calls
4343 if (resolved is PyTargetExpression ) {
44+ // TODO: Handle other cases besides lambda expressions
4445 // Use the target to find the lambda expression object, and assign it to get its parameters up ahead
4546 resolved = PsiTreeUtil .getNextSiblingOfType(resolved, PyLambdaExpression ::class .java) ? : return inlayInfos
4647 }
@@ -73,15 +74,11 @@ class PythonInlayHintsProvider : InlayParameterHintsProvider {
7374 // If there's no parameters in the object, we use the dataclass attributes instead, if there is any
7475 if (resolvedParameters.isEmpty() && dataclassAttributes.isNotEmpty() && ! hasExplicitInit) {
7576 dataclassAttributes.zip(args).forEach { (attr, arg) ->
76- if (arg is PyStarArgument ) {
77- // It's unpacking, so we don't need to show hits after this
77+ if (arg is PyStarArgument || arg is PyKeywordArgument ) {
78+ // It's a keyword argument or unpacking,
79+ // we don't need to show hits after this
7880 return inlayInfos
7981 }
80- if (arg is PyKeywordArgument ) {
81- // Keyword arguments don't need a hint,
82- // Keep for proper ordering and to avoid displaying issues
83- return @forEach
84- }
8582
8683 if (isHintNameValid(attr, arg)) {
8784 inlayInfos.add(InlayInfo (attr, arg.textOffset))
@@ -92,15 +89,11 @@ class PythonInlayHintsProvider : InlayParameterHintsProvider {
9289
9390 resolvedParameters.zip(args).forEach { (param, arg) ->
9491 val paramName = param.name ? : return @forEach
95- if (arg is PyStarArgument ) {
96- // It's unpacking, so we don't need to show hits after this
92+ if (arg is PyStarArgument || arg is PyKeywordArgument ) {
93+ // It's a keyword argument or unpacking,
94+ // we don't need to show hits after this
9795 return inlayInfos
9896 }
99- if (arg is PyKeywordArgument ) {
100- // Keyword arguments don't need a hint,
101- // Keep for proper ordering and to avoid displaying issues
102- return @forEach
103- }
10497
10598 if (param is PyNamedParameter && param.isPositionalContainer) {
10699 // This is an *args parameter that takes more than one argument
0 commit comments