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

Formatting the schema.prisma file makes VSCode scroll down

Open divmgl opened this issue 2 years ago • 7 comments

Bug description

Formatting the schema.prisma file scrolls down by about one "page" of information (about 60 lines).

How to reproduce

  1. Create a schema.prisma file that is larger than a screen's height.
  2. Format the document.
  3. Observe the screen getting scrolled down.

Expected behavior

The document is formatted without scrolling.

Prisma information

Prisma version 5.4.2

Environment & setup

  • OS: macOS
  • Editor: VSCode
  • Editor version: Latest
  • Extension version: Latest

divmgl avatar Nov 10 '23 06:11 divmgl

I can not reproduce this, for me it formats the document and just visually updates the current "view" of the schema file I have, whereever I am scrolled to.

How do you format the document? Is your VS Code configured somehow different than normal?

janpio avatar Nov 10 '23 10:11 janpio

Sorry, I'm still running into this. VSCode is configured with format on save. I'm just using the Prisma extension. We have a really long schema file. We do have

"editor.codeActionsOnSave": {
  "source.fixAll": "explicit"
},

turned on, so maybe that's needed to make this happen? It is extremely annoying but it's not a blocker at all.

I haven't had to time to create a reproduction case but I hope this helps.

divmgl avatar Dec 28 '23 02:12 divmgl

Oh, and it only scrolls down when it needs to format the document on save. Like, if I make a change and press Cmd+S it scrolls down.

divmgl avatar Dec 28 '23 02:12 divmgl

I have the exact same issue. My schema file is 2800 lines long. When I format on save, it jumps down 100 lines.

mriosb avatar Feb 13 '24 15:02 mriosb

So not the "entire window down" as described in the title, but just 100 lines @mriosb?

janpio avatar Feb 14 '24 11:02 janpio