Skip to content

Commit 9b1d335

Browse files
authored
Fix expressions like "-1" or "+1.0" (#16)
1 parent 249a9f4 commit 9b1d335

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • src/main/kotlin/space/whitememory/pythoninlayparams/types/hints

src/main/kotlin/space/whitememory/pythoninlayparams/types/hints/HintResolver.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ enum class HintResolver {
6060
typeEvalContext: TypeEvalContext,
6161
settings: PythonVariablesInlayTypeHintsProvider.Settings
6262
): Boolean {
63+
val assignedValue = PyUtil.peelArgument(element.findAssignedValue())
64+
65+
if (assignedValue is PyPrefixExpression) {
66+
return shouldShowTypeHint(assignedValue.operand as PyElement, typeEvalContext)
67+
}
68+
6369
return shouldShowTypeHint(element, typeEvalContext)
6470
}
6571
},

0 commit comments

Comments
 (0)