mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 06:39:38 +07:00
[uast] IDEA-CR-54112 cleanupMethodCall always return given method
GitOrigin-RevId: 54b03171907396525e0cc0c511a52116dd65e432
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4e1fd81bd9
commit
562be2fbea
@@ -27,7 +27,7 @@ internal class JavaUastCodeGenerationPlugin : UastCodeGenerationPlugin {
|
||||
override val language: Language
|
||||
get() = JavaLanguage.INSTANCE
|
||||
|
||||
private fun cleanupMethodCall(methodCall: PsiMethodCallExpression): PsiMethodCallExpression? {
|
||||
private fun cleanupMethodCall(methodCall: PsiMethodCallExpression): PsiMethodCallExpression {
|
||||
if (methodCall.typeArguments.isNotEmpty()) {
|
||||
val resolved = methodCall.resolveMethod() ?: return methodCall
|
||||
if (methodCall.typeArguments.size == resolved.typeParameters.size &&
|
||||
@@ -40,8 +40,7 @@ internal class JavaUastCodeGenerationPlugin : UastCodeGenerationPlugin {
|
||||
)
|
||||
) {
|
||||
val emptyTypeArgumentsMethodCall = JavaPsiFacade.getElementFactory(methodCall.project)
|
||||
.createExpressionFromText("foo()", null) as? PsiMethodCallExpression
|
||||
?: return methodCall
|
||||
.createExpressionFromText("foo()", null) as PsiMethodCallExpression
|
||||
|
||||
methodCall.typeArgumentList.replace(emptyTypeArgumentsMethodCall.typeArgumentList)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user