Skip to content

VSCode 1.15.1 w/ PowerShell extension 1.4.1 ignores language-specific tabSize for Format Document #33763

@NathanielArnoldR2

Description

@NathanielArnoldR2
  • VSCode Version: 1.15.1
  • OS Version: Windows 10 1703

Steps to Reproduce:

  1. On an otherwise fresh install of VSCode 1.15.1, using PowerShell extension 1.4.1, with user settings configured as follows. The global editor.tabSize is 5 only for illustrative purposes, of course.
{
    "files.defaultLanguage":  "powershell",
    "editor.tabSize":  5,
    "[powershell]":  {
        "editor.detectIndentation":  false,
        "editor.tabSize":  2
    }
}
  1. Open a .ps1 script file containing the following code. Lines subsequent to the first are indented by 4 spaces.
Get-ChildItem -LiteralPath C:\Windows\System32 |
    Where-Object {$_ -is [System.IO.FileInfo]} |
    Where-Object Extension -in .cpl,.msc |
    Sort-Object Length -Descending |
    Select-Object -First 10 |
    Select-Object Name,Length
  1. Notice that the status bar at the bottom of the VSCode window indicates the language is detected as PowerShell, and appears to show the language-specific editor.tabSize (Spaces: 2).

  2. Now right-click within the editor, and select Format Document from the context menu.

  3. The indentation will now be five spaces. The global setting has been applied, and the language-specific setting has been ignored.

Reproduces without extensions: No

Metadata

Metadata

Assignees

No one assigned

    Labels

    *caused-by-extensionIssue identified to be caused by an extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions