C# code formatting ignoring EditorConfig settings
See original GitHub issueFrom @michaldudak on August 18, 2017 11:47
Format selection / Format document commands seem to ignore the current EditorConfig settings when applied to a C# file.
I’m not sure if this repo is the right place for to log the issue. Please correct me if it should be elsewhere.
- VSCode Version: Code 1.15.1 (41abd21afdf7424c89319ee7cb0445cc6f376959, 2017-08-16T18:05:38.342Z)
- OS Version: Windows_NT ia32 10.0.15063
- Extensions:
Extension | Author (truncated) | Version |
---|---|---|
path-intellisense | chr | 1.4.2 |
gitignore | cod | 0.5.0 |
vscode-svgviewer | css | 1.4.2 |
vscode-eslint | dba | 1.2.11 |
githistory | don | 0.2.3 |
EditorConfig | Edi | 0.9.4 |
auto-rename-tag | for | 0.0.14 |
vscode-flatland-icon-theme | geb | 0.0.6 |
vscode-auto-open-markdown-preview | hnw | 0.0.4 |
icon-fonts | idl | 1.8.0 |
vscode-angular2-emmet | jak | 2.0.3 |
Angular2 | joh | 2.4.0 |
vscode-less | mrm | 0.6.3 |
csharp | ms- | 1.12.1 |
PowerShell | ms- | 1.4.1 |
typescript-javascript-grammar | ms- | 0.0.23 |
vs-keybindings | ms- | 0.1.7 |
sass-indented | rob | 1.4.1 |
autoimport | ste | 1.2.2 |
(2 theme extensions excluded)
Steps to Reproduce:
- Have the following
.editorconfig
file in a directory:
root = true
[*]
indent_style = tab
- Create a new C# file indented with tabs
- Run Format Document command on it
- See that tabs were converted to spaces.
One thing to note - "omnisharp.useEditorFormattingSettings"
is set to true
in my configuration.
Reproduces without extensions: No
Copied from original issue: Microsoft/vscode#32776
Issue Analytics
- State:
- Created 6 years ago
- Reactions:26
- Comments:21 (7 by maintainers)
Top Results From Across the Web
C# code formatting is not respecting .editorconfig · Issue #58731
editorconfig ”, but when editing any file in my solutions' projects, the settings in .editorconfig seem to be ignored completely. It (still) ...
Read more >C# code formatting is not respecting .editorconfig
editorconfig ”, but when editing any file in my solutions' projects, the settings in .editorconfig seem to be ignored completely. It (still) works...
Read more >EditorConfig settings - Visual Studio (Windows) - Microsoft Learn
When you add an EditorConfig file to your project in Visual Studio, new lines of code are formatted based on the EditorConfig settings....
Read more >Editorconfig: formatter control options are ignored - YouTrack
We have code using @formatter:off/on to protect breaking the formatting. When pressing the shortcut to reformat the code, all the manual formatting inside...
Read more >Why is my .editorconfig file being ignored? - Stack Overflow
I followed the docs exactly to create my .editorconfig file, but when I do Edit -> Format -> Format Document, my options are...
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 FreeTop 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
Top GitHub Comments
Is there any upstream issue from roslyn to add support for editorconfig that’s trackable anywhere?
Nice that this is merged in the
omnisharp-roslyn
package, but when can we expect this in VS Code? Until the feature works in this repo, I would not really consider this closed.