language-tools
language-tools copied to clipboard
Go To Definition doesn't work if the model belongs to a different schema (Using MultiSchema)
Bug description
In Visual Studio Code, the "Go to Definition" feature does not work when referencing a model defined in a different schema file using Prisma's @@schema annotation in a multi-schema setup.
How to reproduce
- Create a Prisma project with multiple schema files using the
@@schemaannotation. - In Schema A, define a model named
Test. - In Schema B, define another model named
Test_2and reference theTestmodel (e.g., as a relation field). - Attempt to use "Go to Definition" on the reference to
TestwithinTest_2.
Expected behavior
It should navigate me to the Test Model Definition.
Prisma information
generator client {
provider = "prisma-client-js"
output = "../src/generated/prisma"
previewFeatures = ["multiSchema"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
schemas = ["schemaA", "schemaB"]
}
// schema.prisma
model Test {
id Int @id
@@schema("schemaA")
}
// schemaB.prisma
model Test_2 {
id Int @id
test Test @relation(fields: [testId], references: [id])
testId Int
@@schema("schemaB")
}
Environment & setup
- OS: Windows
- Editor: VS Code
- Editor version: 1.101.2
- Extension version: v.6.10.1