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.

C# code formatting ignoring EditorConfig settings

See original GitHub issue

From @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:

  1. Have the following .editorconfig file in a directory:
root = true

[*]
indent_style = tab
  1. Create a new C# file indented with tabs
  2. Run Format Document command on it
  3. 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:closed
  • Created 6 years ago
  • Reactions:26
  • Comments:21 (7 by maintainers)

github_iconTop GitHub Comments

14reactions
Alxandrcommented, Mar 3, 2019

Is there any upstream issue from roslyn to add support for editorconfig that’s trackable anywhere?

7reactions
guidoboumancommented, Jun 24, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

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