Skip to content

Commit 76708fb

Browse files
committed
Enhancement: Add KDoc comments for validation result classes and improve parameter naming
1 parent cb2755d commit 76708fb

File tree

6 files changed

+17
-2
lines changed

6 files changed

+17
-2
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/sql/foritem/ForDeclarationDaoBaseItem.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ class ForDeclarationDaoBaseItem(
4040
SqlElFieldAccessorChildElementValidator(
4141
blocks,
4242
element.containingFile,
43-
"",
44-
daoParameter,
43+
topDaoParameter = daoParameter,
4544
)
4645

4746
var lastType: PsiParentClass? = null

src/main/kotlin/org/domaframework/doma/intellij/common/sql/validator/result/ValidationCompleteResult.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import com.intellij.openapi.util.TextRange
2121
import com.intellij.psi.PsiElement
2222
import org.domaframework.doma.intellij.common.psi.PsiParentClass
2323

24+
/**
25+
* This class represents successful completion of field access analysis.
26+
*/
2427
class ValidationCompleteResult(
2528
override val identify: PsiElement,
2629
override val parentClass: PsiParentClass,

src/main/kotlin/org/domaframework/doma/intellij/common/sql/validator/result/ValidationDaoParamResult.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import com.intellij.psi.PsiElement
2222
import org.domaframework.doma.intellij.bundle.MessageBundle
2323
import org.domaframework.doma.intellij.common.psi.PsiParentClass
2424

25+
/**
26+
* no Dao parameter matching the name of the field access top was found
27+
*/
2528
class ValidationDaoParamResult(
2629
override val identify: PsiElement,
2730
private val daoName: String,

src/main/kotlin/org/domaframework/doma/intellij/common/sql/validator/result/ValidationPropertyResult.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import com.intellij.psi.PsiElement
2323
import org.domaframework.doma.intellij.bundle.MessageBundle
2424
import org.domaframework.doma.intellij.common.psi.PsiParentClass
2525

26+
/**
27+
* This class indicates that there is no field or method defined in the class that matches the target name.
28+
*/
2629
class ValidationPropertyResult(
2730
override val identify: PsiElement,
2831
override val parentClass: PsiParentClass?,

src/main/kotlin/org/domaframework/doma/intellij/common/sql/validator/result/ValidationResult.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ abstract class ValidationResult(
5757
project: Project,
5858
)
5959

60+
/**
61+
* Highlight level is determined according to the settings
62+
*/
6063
protected fun problemHighlightType(
6164
project: Project,
6265
shortName: String,

src/main/kotlin/org/domaframework/doma/intellij/inspection/ForDirectiveInspection.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ class ForDirectiveInspection(
6767
forItem?.let { return ForItem(it.item) } ?: return null
6868
}
6969

70+
/**
71+
* Analyze the field access of the for item definition and finally get the declared type
72+
* @return [ValidationResult] is used to display the analysis results.
73+
*/
7074
fun checkForItem(blockElements: List<PsiElement>): ValidationResult? {
7175
val targetElement: PsiElement = blockElements.firstOrNull() ?: return null
7276
val file = targetElement.containingFile ?: return null

0 commit comments

Comments
 (0)