Skip to content

Commit a8f5e29

Browse files
committed
Fix expand directive handling in SQL validation and correct variable names in test data
1 parent 8c41249 commit a8f5e29

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/validation/result/ValidationTestDataResult.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,24 @@ import org.domaframework.doma.intellij.common.psi.PsiParentClass
2424
class ValidationTestDataResult(
2525
override val identify: PsiElement?,
2626
override val shortName: String = "",
27+
private val expand: Boolean,
2728
) : ValidationResult(identify, null, shortName) {
2829
override fun setHighlight(
2930
highlightRange: TextRange,
3031
identify: PsiElement,
3132
holder: ProblemsHolder,
3233
parent: PsiParentClass?,
3334
) {
35+
val message =
36+
if (expand) {
37+
MessageBundle.message("inspection.invalid.sql.expand")
38+
} else {
39+
MessageBundle.message("inspection.invalid.sql.testdata")
40+
}
3441
val project = identify.project
3542
holder.registerProblem(
3643
identify,
37-
MessageBundle.message("inspection.invalid.sql.testdata"),
44+
message,
3845
problemHighlightType(project, shortName),
3946
highlightRange,
4047
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
SELECT /*%expand*/* FROM employee
2-
WHERE rank < <error descr="Test data is required after a bind variable directive or a literal variable directive">/* emplotee.rank */</error>*
2+
WHERE rank < <error descr="Test data is required after a bind variable directive or a literal variable directive">/* employee.rank */</error>*
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
SELECT <error descr="Asterisk is required after expand variable">/*%expand*/</error>0 FROM employee
2-
WHERE rank < /* emplotee.rank */0
2+
WHERE rank < /* employee.rank */0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
UPDATE employee
22
SET /*%populate*/id = id
3-
WHERE rank < <error descr="Test data is required after a bind variable directive or a literal variable directive">/* emplotee.rank */</error>
3+
WHERE rank < <error descr="Test data is required after a bind variable directive or a literal variable directive">/* employee.rank */</error>

0 commit comments

Comments
 (0)