Skip to content

Commit 5a5d382

Browse files
authored
Merge pull request #290 from domaframework/chore/sql-format-refactor-block-class
Chore/sql format refactor block class
2 parents ec5ab28 + 3247255 commit 5a5d382

File tree

96 files changed

+2993
-1979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2993
-1979
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/util/TypeUtil.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import org.domaframework.doma.intellij.extension.getJavaClazz
2424
import org.domaframework.doma.intellij.extension.psi.getClassAnnotation
2525
import org.domaframework.doma.intellij.extension.psi.isDomain
2626
import org.domaframework.doma.intellij.extension.psi.isEntity
27+
import org.domaframework.doma.intellij.formatter.block.SqlBlock
28+
import kotlin.reflect.KClass
2729

2830
object TypeUtil {
2931
/**
@@ -94,4 +96,15 @@ object TypeUtil {
9496
if (type == null) return false
9597
return PsiTypeChecker.isBaseClassType(type) || DomaClassName.isOptionalWrapperType(type.canonicalText)
9698
}
99+
100+
/**
101+
* Determines whether the specified class instance matches.
102+
*/
103+
fun isExpectedClassType(
104+
expectedClasses: List<KClass<*>>,
105+
childBlock: SqlBlock,
106+
): Boolean =
107+
expectedClasses.any { clazz ->
108+
clazz.isInstance(childBlock)
109+
}
97110
}

src/main/kotlin/org/domaframework/doma/intellij/formatter/SqlBlockUtil.kt

Lines changed: 0 additions & 303 deletions
This file was deleted.

0 commit comments

Comments
 (0)