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"]
}
model Test {
id Int @id
@@schema("schemaA")
}
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
def run_titan_advisors(): logging.info("הפעלת יועצי TITAN עם כלי חיזוי - מחזור חדש") total_revenue = 0.0
# המרת נתוני היועצים לפורמט אחיד (AdvisorState)
advisors: List[AdvisorState] = []
for aid, raw in advisors_data.items():
advisors.append(
AdvisorState(
id=aid,
name=raw.get("name", f"Advisor-{aid}"),
rank=raw.get("rank", "bronze"),
stars=raw.get("stars", 0),
kpi_revenue=raw.get("kpi_revenue", 0.0),
questions=raw.get("questions", 0),
global_questions=raw.get("global_questions", 0),
travel_tasks=raw.get("travel_tasks", 0),
campaigns_google_ads=raw.get("campaigns_google_ads", 0),
meta=copy.deepcopy(raw.get("meta", {})),
)
)
# אתחול שירותים חיצוניים (במצב DRY_RUN לא מתחברים באמת)
gmail_service = None
adwords_client = None
# לולאה על כל יועץ במערכת
for advisor in advisors:
tasks = assign_tasks(advisor)
revenue = execute_tasks(advisor, tasks)
# עדכון מדדי הביצועים של היועץ (KPIs)
advisor.kpi_revenue += revenue
advisor.questions += len(tasks)
advisor.global_questions += len(tasks) // 2
advisor.travel_tasks += sum(1 for t in tasks if t["type"] == "travel")
advisor.campaigns_google_ads += 1 if random.random() < 0.2 else 0
# קידום דרגה אם יש צורך
promote_rank_if_needed(advisor)
# שיגור נתונים לכלי חיזוי אנליטי
forecast_data = {
"revenue": revenue,
"tasks": len(tasks),
"probability_weight": RANK_LEVELS[advisor.rank]["probability_weight"],
}
manage_forecast_tool("h2o_ai", None, forecast_data)
# עדכון ההכנסה הכוללת
total_revenue += revenue
# ניהול קמפיינים, עדכון טבלה ושליחת התראה
manage_google_ads(adwords_client, "INSERT_CAMPAIGN_ID_HERE", 1000.0, total_revenue)
update_live_table(advisors)
alert_message = (
f"מחזור TITAN הושלם: הכנסות ${total_revenue:.2f}, "
f"יועצים: {len(advisors)}, "
f"שאלות גלובליות: {sum(a.global_questions for a in advisors)}"
)
send_gmail_alert(alert_message, gmail_service)
# החזרת התוצאות בפורמט נוח
result = {
a.id: {
"name": a.name,
"rank": a.rank,
"stars": a.stars,
"kpi_revenue": a.kpi_revenue,
"questions": a.questions,
"global_questions": a.global_questions,
"travel_tasks": a.travel_tasks,
"campaigns_google_ads": a.campaigns_google_ads,
"meta": a.meta,
}
for a in advisors
}
return result, total_revenue