Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# code formatting ignoring EditorConfig settings #1726

Open
aeschli opened this Issue Aug 21, 2017 · 17 comments

Comments

Projects
None yet
@aeschli
Copy link
Contributor

commented Aug 21, 2017

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

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Aug 21, 2017

EditorConfig support has not been added for C# for VS Code. I'll use this project to track adding this feature in the future.

@rchande

This comment has been minimized.

Copy link
Contributor

commented Oct 6, 2017

I bet we'll get a lot of this for free once Roslyn finishes implementing editorconfig support for the compiler (cc @jasonmalinowski @jinujoseph)

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Oct 6, 2017

I bet we won't 😄

@rchande

This comment has been minimized.

Copy link
Contributor

commented Oct 6, 2017

I'm curious, why not?

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Oct 6, 2017

I'm just betting on it not working based on looking at editorconfig in the past and finding that everything was completely internal. How would it get into the OmniSharpWorkspace? Just because it would be passed into the compiler doesn't mean it would make it's way into our workspace options automatically.

@jasonmalinowski

This comment has been minimized.

Copy link

commented Oct 13, 2017

Well, it should Just Work because if it doesn't, you can yell at us to finish the job. 😉 Given we have to support in the same API the command line compiler, the VS inproc and out of proc workspaces...we have to design it flexibly.

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Oct 13, 2017

@jasonmalinowski : Could you loop me in to that design work? I'd like to make sure it meets our needs.

@jasonmalinowski

This comment has been minimized.

Copy link

commented Oct 16, 2017

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Oct 16, 2017

Loop in @rchande too.

@Nepoxx

This comment has been minimized.

Copy link

commented Nov 17, 2017

@rchande

once Roslyn finishes implementing editorconfig support for the compiler

Are there any plans for that?

@jinujoseph

This comment has been minimized.

Copy link

commented Nov 17, 2017

yes @Nepoxx
This has been in our Wish list for a while Link

@StewMcc

This comment has been minimized.

Copy link

commented Dec 14, 2017

Is there a workaround for this atm, other than disabling the plugin?

@richardthombs

This comment has been minimized.

Copy link

commented Feb 14, 2018

When will this issue be fixed please?

@NTaylorMullen

This comment has been minimized.

Copy link
Contributor

commented May 17, 2018

This would be great to have.

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented May 18, 2018

The work on the Roslyn side to integrate .editorconfig support into the compiler is not yet complete, but is in progress. This is necessary before we can make this work in C# for VS Code.

@AnthonyMastrean

This comment has been minimized.

Copy link

commented Feb 20, 2019

@DustinCampbell Am I right, based on this comment, that you're tracking EditorConfig support here? If so, is there any chance that you'll be working toward the extended list of .NET coding conventions that Visual Studio supports?

@Alxandr

This comment has been minimized.

Copy link

commented Mar 3, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.