PY-87182 type representation: fix issue with single star parameter

GitOrigin-RevId: aa60094e6fbb8cc4a9e0c129accc917b7933c7a4
This commit is contained in:
Morgan Bartholomew
2026-01-30 07:04:49 +00:00
committed by intellij-monorepo-bot
parent a0c7b5e7b6
commit c7435bdc99
2 changed files with 3 additions and 6 deletions
@@ -18,6 +18,7 @@ package com.jetbrains.python.codeInsight.typeRepresentation
import com.intellij.lang.SyntaxTreeBuilder
import com.intellij.openapi.util.NlsContexts
import com.intellij.psi.tree.IElementType
import com.jetbrains.python.PYTHON_VERSION_ARG
import com.jetbrains.python.PyElementTypes
import com.jetbrains.python.PyParsingBundle
import com.jetbrains.python.PyTokenTypes
@@ -252,7 +253,7 @@ class PyTypeRepresentationParser : PyParser() {
}
namedVarargMarker.done(PyTypeRepresentationElementTypes.NAMED_PARAMETER_TYPE)
}
else {
else if (atToken(PyTokenTypes.IDENTIFIER)) {
// Unnamed *args, just parse the type
parseExpression()
}
@@ -4,11 +4,7 @@ TypeRepresentation:a.pythonTypeRepresentation
PsiElement(Py:LPAR)('(')
PyStarExpression
PsiElement(Py:MULT)('*')
PsiErrorElement:Unexpected token
<empty list>
PsiElement(Py:RPAR)(')')
PsiErrorElement:')' expected
<empty list>
PsiElement(Py:RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(Py:RARROW)('->')
PsiWhiteSpace(' ')