Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
package org.mapstruct.intellij.util.patterns;

import com.intellij.patterns.ElementPattern;
import com.intellij.patterns.PlatformPatterns;
import com.intellij.patterns.PsiElementPattern;
import com.intellij.psi.PsiElement;
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes;
import org.jetbrains.kotlin.psi.KtStringTemplateExpression;

import static org.mapstruct.intellij.util.patterns.MapStructKotlinPatterns.ktAnnotation;
import static org.mapstruct.intellij.util.patterns.MapStructKotlinPatterns.ktValueArgument;
Expand Down Expand Up @@ -36,7 +37,7 @@ public Self insideRepeatableAnnotationParam(
// @Mapping(target = "name")

KtValueArgumentPattern ktValueArgumentPattern = ktValueArgument().withName( parameterName );
return withElementType( KtStubElementTypes.STRING_TEMPLATE ).andOr(
return and( PlatformPatterns.psiElement( KtStringTemplateExpression.class ) ).andOr(
withParent(
ktValueArgumentPattern
.withAncestor( 5, ktAnnotation().qName( annotationHolderQualifiedName ) )
Expand All @@ -54,7 +55,7 @@ public Self insideAnnotationParam(
String parameterName) {

KtValueArgumentPattern ktValueArgumentPattern = ktValueArgument().withName( parameterName );
return withElementType( KtStubElementTypes.STRING_TEMPLATE ).andOr(
return and( PlatformPatterns.psiElement( KtStringTemplateExpression.class ) ).andOr(
withAncestor(
2,
ktValueArgumentPattern
Expand Down
Loading