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.

Language-Specific editor.* Settings Ignored When Formatting Document

See original GitHub issue

System Details

  • Operating system name and version: Windows 10 1703 (15063)
  • VS Code version: 1.15.1
  • PowerShell extension version 1.4.1:
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.15063.502
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.502
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
  • Output from code -v:
1.15.1
41abd21afdf7424c89319ee7cb0445cc6f376959
  • Output from $psEditor.EditorServicesVersion:
Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0
  • Output from code --list-extensions --show-versions:
ms-vscode.PowerShell

Issue Description

PSDocumentFormattingEditProvider.getEditorSettings does not currently consume language-specific editor settings, if defined.

I have fixed this on a local copy of the extension by replacing "editor" with "powershell" in the call to vscode.workspace.getConfiguration, but I am not familiar enough with the language and environment to determine if this is a proper solution.

Full replication steps with description of practical impact are in this (rightfully) closed VSCode issue.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jimp02commented, Sep 8, 2017

I have this problem also.

In the user settings file I have: “editor.insertSpaces”: false,

Then a powershell configuration override with: “[powershell]”: { “editor.insertSpaces”: true },

When I select “Format Document” in the context menu, the file is formatted with tabs. The powershell configuration override setting is ignored.

1reaction
SydneyhSmithcommented, Jun 25, 2019

Closing as the PR has been merged…thanks for the fix @tillig!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

User and Workspace Settings - Visual Studio Code
Another way to customize your editor by language is by running the global command Preferences: Configure Language Specific Settings (command ID: workbench.
Read more >
Prettier vscode extension ignoring config files - Stack Overflow
I set prettier as default and I formatted by using the "format document with..." option in the right click context menu and it...
Read more >
HTML specific language user setting of tabSize=2 is being ...
Actually any number at "editor.tabSize" seems to be ignored - could not manage to achieve any formatting different to "4 spaces".
Read more >
EditorConfig settings - Visual Studio (Windows) - Microsoft Learn
Create portable, custom editor settings with EditorConfig ... Edit > Advanced > Format Document (or Ctrl+K, Ctrl+D in the default profile), ...
Read more >
How to configure Prettier and VSCode - Gleb Bahmutov
I like using JSON configuration format so my code editor helps me. In fact, VSCode understands the Prettier configuration file format via ...
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