question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
pantharshit00commented, Dec 14, 2021

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

2reactions
janpiocommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code: format is not using indent settings
If it is the case, then just open Command Palette, type "Formatter" and select Formatter Config . Then edit the value of "indent_size"...
Read more >
VS Code tips — Indentation settings and the ... - YouTube
VS Code shows the indentation settings for the current in the status bar. Click on this entry to quickly change the tab size...
Read more >
User and Workspace Settings - Visual Studio Code
To open the Settings editor, use the following VS Code menu command: On Windows/Linux - File > Preferences > Settings; On macOS -...
Read more >
Basic Editing in Visual Studio Code
Learn about the basic editing features of Visual Studio Code. Search, multiple selection, code formatting.
Read more >
VS Code API | Visual Studio Code Extension API
Custom documents are only used within a given CustomEditorProvider . The lifecycle of a CustomDocument is managed by the editor. When no more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found