-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...t/tests/code_actions/scenarios/add_missing_relation_attribute_args_references/result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[ | ||
{ | ||
"title": "Add relation attribute for relation field", | ||
"kind": "quickfix", | ||
"diagnostics": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 3, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"character": 0 | ||
} | ||
}, | ||
"severity": 1, | ||
"message": "Error parsing attribute \"@relation\": The relation field `organization` on Model `user` must specify the `fields` argument in the @relation attribute. You can run `prisma format` to fix this automatically." | ||
} | ||
], | ||
"edit": { | ||
"changes": { | ||
"file:///path/to/schema.prisma": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 3, | ||
"character": 33 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"character": 60 | ||
} | ||
}, | ||
"newText": "@relation(fields: [], references: [id])" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] |
10 changes: 10 additions & 0 deletions
10
...tests/code_actions/scenarios/add_missing_relation_attribute_args_references/schema.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
model user { | ||
id String @id | ||
email String @unique | ||
organization organization? @relation(references: [id]) | ||
} | ||
|
||
model organization { | ||
id String @id | ||
users user[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters