Skip to content

Commit 02979db

Browse files
committed
fix: fix get issues
1 parent 2897dd7 commit 02979db

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

java/src/main/kotlin/cc/unitmesh/idea/DtModelExt.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ fun DtClass.Companion.fromPsi(originClass: PsiClass): DtClass {
4343

4444
val methods = psiClass.methods.map { method ->
4545
// if method is getter or setter, skip
46-
if (method.name.startsWith("get") || method.name.startsWith("set")) {
46+
val isGetter = method.name.startsWith("get")
47+
&& method.parameters.isEmpty()
48+
&& !(method.name.contains("By") || method.name.contains("With") || method.name.contains("And"))
49+
50+
val isSetter = method.name.startsWith("set") && method.parameters.size == 1
51+
if (isGetter || isSetter) {
4752
return@map null
4853
}
4954

0 commit comments

Comments
 (0)