Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode plugin formatting no longer uses editor tabSize configuration when indenting blocks #993

Closed
evdhiggins opened this issue Dec 8, 2021 · 6 comments · Fixed by #1006
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/regression A reported bug in functionality that used to work before. topic: formatting topic: prisma-fmt
Milestone

Comments

@evdhiggins
Copy link

evdhiggins commented Dec 8, 2021

Bug description

Prior to v3.6, the VSCode extension would indent blocks with a tab size that would take into consideration editor / user settings.

How to reproduce

Using v3.6

  1. Add a non-2 tabsize configuration to settings.json
      "[prisma]": {
        "editor.defaultFormatter": "Prisma.prisma",
        "editor.tabSize": 4,
      },
  2. Format the a prisma schema using VSCode
  3. The blocks will be formatted with a tab size of 2, ignoring the VSCode tabSize configuration

Expected behavior

The formatted code's block indention would match the tab size specified in the user / editor settings.

Using v3.5

  1. Add a non-2 tabsize configuration to settings.json
      "[prisma]": {
        "editor.defaultFormatter": "Prisma.prisma",
        "editor.tabSize": 4,
      },
  2. Format the a prisma schema using VSCode
  3. The blocks will be formatted with a tab size of 4, honoring the VSCode tabSize configuration

Prisma information

N/A

Environment & setup

  • Editor: VSCode
  • Editor version: 1.62.3
  • Extension version: 3.6
@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. topic: formatting labels Dec 8, 2021
@tomhoule tomhoule added process/candidate Candidate for next Milestone. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. labels Dec 9, 2021
@ruheni ruheni added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Dec 14, 2021
@pantharshit00
Copy link
Contributor

I can confirm this as a regression.

Note for anyone else on the team: Make sure to use tabs for indentation instead of spaces when you try to reproduce this. You can find that setting on bottom right hand of the editor.

image

@pantharshit00 pantharshit00 added kind/regression A reported bug in functionality that used to work before. and removed kind/bug A reported bug. labels Dec 14, 2021
@janpio janpio added this to the 3.7.0 milestone Dec 14, 2021
@Jolg42 Jolg42 modified the milestones: 3.7.0, 3.8.0 Dec 21, 2021
@Jolg42
Copy link
Contributor

Jolg42 commented Dec 22, 2021

I could reproduce too and found the issue, when we switched to wasm we didn't implement passing the identSize to prisma-fmt see:
https://github.com/prisma/language-tools/pull/950/files#diff-cb7aa19eb853bb2d86ec84a097509268d237443aa9fb220ab533bea42d4d89ceL10-R9
Screen Shot 2021-12-22 at 18 15 16

@janpio
Copy link
Contributor

janpio commented Dec 22, 2021

@janpio janpio removed the process/candidate Candidate for next Milestone. label Dec 22, 2021
@tomhoule
Copy link
Contributor

Opened prisma/prisma-engines#2538 to fix this.

tomhoule added a commit that referenced this issue Dec 23, 2021
tabSize is now taken into account again. I confirmed this through manual
testing.

closes #993
@rujorgensen
Copy link

Is this fixed in v. 3.7.0? I seem to still be having this issue 🤔.

@janpio
Copy link
Contributor

janpio commented Jan 2, 2022

No, it will be fixed in 3.8.0. You can try it out using the Prisma - Insider extension from the marketplace already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/regression A reported bug in functionality that used to work before. topic: formatting topic: prisma-fmt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants