Skip to content

Commit f00f568

Browse files
committed
Revert: partial match search
1 parent 2a05076 commit f00f568

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/psi/PsiParentClass.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PsiParentClass(
4949

5050
fun searchField(fieldName: String): List<PsiField>? =
5151
fields?.filter { f ->
52-
f.name.contains(fieldName) &&
52+
f.name.startsWith(fieldName) &&
5353
PropertyModifyUtil.filterPrivateField(f, type)
5454
}
5555

@@ -80,7 +80,7 @@ class PsiParentClass(
8080
fields
8181
?.filter { f ->
8282
f.hasModifierProperty(PsiModifier.STATIC) &&
83-
f.name.contains(fieldName) &&
83+
f.name.startsWith(fieldName) &&
8484
PropertyModifyUtil.filterPrivateField(f, type)
8585
}
8686

src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/PercentDirectiveHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class PercentDirectiveHandler(
4848
"for",
4949
"!",
5050
).filter {
51-
it.contains(bind)
51+
it.startsWith(bind)
5252
}.map {
5353
LookupElementBuilder
5454
.create(it)

src/main/kotlin/org/domaframework/doma/intellij/extension/psi/PsiClassExtension.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ val PsiClass.psiClassType: PsiClassType
2929
fun PsiClass.searchStaticField(searchName: String): Array<PsiField> =
3030
this.allFields
3131
.filter {
32-
it.name.contains(searchName) &&
32+
it.name.startsWith(searchName) &&
3333
it.hasModifierProperty(PsiModifier.STATIC) &&
3434
PropertyModifyUtil.filterPrivateField(it, this.psiClassType)
3535
}.toTypedArray()
@@ -44,7 +44,7 @@ fun PsiClass.findStaticField(searchName: String): PsiField? =
4444
fun PsiClass.searchStaticMethod(searchName: String): Array<PsiMethod> =
4545
this.allMethods
4646
.filter {
47-
it.name.contains(searchName) &&
47+
it.name.startsWith(searchName) &&
4848
it.hasModifierProperty(PsiModifier.STATIC) &&
4949
it.hasModifierProperty(PsiModifier.PUBLIC)
5050
}.toTypedArray()

src/main/kotlin/org/domaframework/doma/intellij/extension/psi/PsiMethodExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fun PsiMethod.findParameter(searchName: String): PsiParameter? = this.methodPara
2424
val PsiMethod.methodParameters: List<PsiParameter>
2525
get() = this.parameterList.parameters.toList()
2626

27-
fun PsiMethod.searchParameter(searchName: String): List<PsiParameter> = this.methodParameters.filter { it.name.contains(searchName) }
27+
fun PsiMethod.searchParameter(searchName: String): List<PsiParameter> = this.methodParameters.filter { it.name.startsWith(searchName) }
2828

2929
@OptIn(ExperimentalStdlibApi::class)
3030
fun PsiMethod.getDomaAnnotationType(): DomaAnnotationType {

0 commit comments

Comments
 (0)