prisma / language-tools

🌐 Prisma Language Tools = Language Server and Prisma's VS Code extension.
https://marketplace.visualstudio.com/items?itemName=Prisma.prisma
Apache License 2.0
257 stars 40 forks source link

Slow performance with Prisma extension when .prisma file is in root directory #1774

Open nuintun opened 5 months ago

nuintun commented 5 months ago

Bug description

Since version 5.15.0, the extension runs very slowly whenever there is a .prisma file in the root directory of the project. Linting and formatting take more than 2 seconds to respond. However, when moving the .prisma file to any other folder, the running speed returns to normal.

How to reproduce

  1. Create a project with a .prisma file in the root directory.
  2. Use the extension to lint or format the file.
  3. Notice the delay in response (more than 2 seconds).
  4. Move the .prisma file to a different folder.
  5. Use the extension again and observe that the response time is normal.

Expected behavior

Linting and formatting should respond quickly even when the .prisma file is located in the root directory of the project.

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "sqlserver"
  url      = env("DATABASE_URL")
}

model User {
  id        Int      @id @default(autoincrement())
  name      String
  email     String   @unique
  posts     Post[]
}

model Post {
  id        Int      @id @default(autoincrement())
  title     String
  content   String?
  published Boolean  @default(false)
  authorId  Int
  author    User     @relation(fields: [authorId], references: [id])
}

Environment & setup

SheaBelsky commented 3 months ago

This is happening to us as of version 5.14 of the extension. Staying on 5.13 preserves extension performance as normal.