Skip to content

Commit

Permalink
feat(psl): enclose recommended type in quotes
Browse files Browse the repository at this point in the history
Closes #15174
  • Loading branch information
pranayat committed Apr 4, 2024
1 parent 8e62d98 commit 8398e80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion psl/diagnostics/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl DatamodelError {

pub fn new_type_for_case_not_found_error(type_name: &str, suggestion: &str, span: Span) -> DatamodelError {
let msg = format!(
"Type \"{type_name}\" is neither a built-in type, nor refers to another model, custom type, or enum. Did you mean {suggestion}?"
"Type \"{type_name}\" is neither a built-in type, nor refers to another model, custom type, or enum. Did you mean \"{suggestion}\"?"
);
Self::new(msg, span)
}
Expand Down
4 changes: 2 additions & 2 deletions psl/psl/tests/base/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ fn must_return_good_error_message_for_type_match() {
let error = parse_unwrap_err(dml);

let expected = expect![[r#"
[1;91merror[0m: [1mType "datetime" is neither a built-in type, nor refers to another model, custom type, or enum. Did you mean DateTime?[0m
[1;91merror[0m: [1mType "datetime" is neither a built-in type, nor refers to another model, custom type, or enum. Did you mean "DateTime"?[0m
--> schema.prisma:5
 | 
 4 | model B {
Expand All @@ -281,7 +281,7 @@ fn must_return_good_error_message_for_type_match() {
 5 |  a datetime
 6 |  b footime
 | 
[1;91merror[0m: [1mType "user" is neither a built-in type, nor refers to another model, custom type, or enum. Did you mean User?[0m
[1;91merror[0m: [1mType "user" is neither a built-in type, nor refers to another model, custom type, or enum. Did you mean "User"?[0m
--> schema.prisma:7
 | 
 6 |  b footime
Expand Down

0 comments on commit 8398e80

Please sign in to comment.