-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prisma-fmt: add a regression test for panic with multiSchema
prisma/language-tools#1473 was also fixed by #4087, this PR adds a regression test for that issue as well. Closes: prisma/language-tools#1473
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#[test] | ||
fn code_actions_should_not_crash_on_validation_errors_with_multi_schema() { | ||
let schema = r#" | ||
generator client { | ||
provider = "prisma-client-js" | ||
previewFeatures = ["multiSchema"] | ||
} | ||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
schemas = ["auth", "public"] | ||
} | ||
model A { | ||
id Int @id | ||
test | ||
} | ||
"#; | ||
|
||
let params = lsp_types::CodeActionParams { | ||
text_document: lsp_types::TextDocumentIdentifier { | ||
uri: "file:/path/to/schema.prisma".parse().unwrap(), | ||
}, | ||
range: lsp_types::Range::default(), | ||
context: lsp_types::CodeActionContext::default(), | ||
work_done_progress_params: lsp_types::WorkDoneProgressParams { work_done_token: None }, | ||
partial_result_params: lsp_types::PartialResultParams { | ||
partial_result_token: None, | ||
}, | ||
}; | ||
|
||
prisma_fmt::code_actions(schema.to_owned(), &serde_json::to_string_pretty(¶ms).unwrap()); | ||
} |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
mod language_tools_1466; | ||
mod language_tools_1473; |