From d92140de2cf6d079cac8ec30a0189690a3ac2fa2 Mon Sep 17 00:00:00 2001 From: mgroth0 Date: Sun, 29 Dec 2024 13:23:11 -0500 Subject: [PATCH] remove a getPsi() from TrailingCommaOnDeclarationSiteRule --- .../standard/rules/TrailingCommaOnDeclarationSiteRule.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TrailingCommaOnDeclarationSiteRule.kt b/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TrailingCommaOnDeclarationSiteRule.kt index 2e82158251..6366168d36 100644 --- a/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TrailingCommaOnDeclarationSiteRule.kt +++ b/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TrailingCommaOnDeclarationSiteRule.kt @@ -41,6 +41,7 @@ import org.ec4j.core.model.PropertyType.PropertyValueParser import org.jetbrains.kotlin.KtNodeTypes.WHEN_ENTRY_GUARD import org.jetbrains.kotlin.com.intellij.lang.ASTNode import org.jetbrains.kotlin.com.intellij.psi.PsiElement +import org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.LeafElement import org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.LeafPsiElement import org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.PsiWhiteSpaceImpl import org.jetbrains.kotlin.com.intellij.psi.tree.TokenSet @@ -324,7 +325,7 @@ public class TrailingCommaOnDeclarationSiteRule : .treeParent .indent() if (leafBeforeArrowOrNull.isWhiteSpace()) { - (leafBeforeArrowOrNull.psi as LeafPsiElement).rawReplaceWithText(indent) + (leafBeforeArrowOrNull as LeafElement).rawReplaceWithText(indent) } else { inspectNode .prevCodeLeaf()