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

Add support for "editor.formatOnSaveMode": "modifications" in VS Code

Open hardnold opened this issue 2 years ago • 1 comments

Problem

In my VS Code settings.json, if editor.formatOnSaveMode is set to "modifications" the formatting for prisma files does not work - formatting is not done when saving. It only works without this setting or if it is set to "file".

Suggested solution

I want the formatter to only format the modified lines if editor.formatOnSaveMode is set to "modifications".

hardnold avatar Sep 06 '22 12:09 hardnold

I can confirm this behavior. Both "editor.formatOnSaveMode": "modifications" and "editor.formatOnSaveMode": "modificationsIfAvailable" don't work.

As a workaround, I added the following to my settings.json:

"editor.formatOnSaveMode": "modificationsIfAvailable",
"[prisma]": {
  "editor.formatOnSaveMode": "file",
},

Perhaps it could be documented here, until the other modes get supported?

BrunoRoemers avatar Mar 21 '23 12:03 BrunoRoemers