language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

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

Open nuintun opened this issue 1 year ago • 2 comments

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

  • OS: Windows 11
  • Editor: VSCode
  • Editor version: 1.90.2 (system setup)
  • Extension version: 5.16.0

nuintun avatar Jun 25 '24 14:06 nuintun

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

SheaBelsky avatar Aug 07 '24 14:08 SheaBelsky

Can confirm this is still a problem with v6.4.1 of the extension. Moving schema.prisma into my src folder avoids the issue.

  • Cursor v0.45.14
  • VSCode v1.96.2
  • macOS Sequoia 15.2

aleclarson avatar Feb 28 '25 20:02 aleclarson