Language-Specific editor.* Settings Ignored When Formatting Document
See original GitHub issueSystem 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:
- Created 6 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Closing as the PR has been merged…thanks for the fix @tillig!!