Skip to content

Commit 9641f57

Browse files
committed
Fix error print
1 parent e8cb186 commit 9641f57

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

kclvm/tools/src/LSP/src/test_data/schema_validation/validator_test.k

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ nested_person3 = NestedPerson {
5858
}
5959
}
6060

61-
# Test case 7: Invalid instance - missing required 'age' attribute
61+
# Test case 7: Invalid instance - missing required 'age' attribute in lambda return
6262
# Expected error: Missing required attributes in Person instance: age
6363
# Expected error line: 70
6464
CreateTest = lambda name: str -> NestedPerson {

kclvm/tools/src/LSP/src/validator.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ fn validate_schema_instance(
172172
for item in &config_expr.items {
173173
if let Node {
174174
node: Expr::Schema(_),
175+
filename,
176+
line,
177+
column,
175178
..
176179
} = &*item.node.value
177180
{
@@ -183,8 +186,8 @@ fn validate_schema_instance(
183186
&nested_assign,
184187
schema_attrs,
185188
filename,
186-
line,
187-
column,
189+
*line,
190+
*column,
188191
diagnostics,
189192
);
190193
}

0 commit comments

Comments
 (0)