razor icon indicating copy to clipboard operation
razor copied to clipboard

Add editorconfig support in Razor

Open allisonchou opened this issue 3 years ago • 14 comments

Tracking issue on the Razor side for adding editorconfig support in Razor. Will likely need to discuss with Platform since the bulk of the work may need to be done on their side.

See 1) in: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1388770/ for original VSTS issue.


There are a few different aspects to .editorconfig support, with different statuses and priorities:

Current status:

  1. Support for indent_size, indent_style etc. generic formatting properties, as per the original linked issue above
    • Blocked by the Visual Studio editor, tracked internally by https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1408493
  2. Support for start C# editor config controls in document formatting, eg code style
    • Not supported, is possible with bigger architectural changes like https://github.com/dotnet/razor/issues/6919
  3. Support for razor specific editorconfig controls for formatting and other behaviours
    • Tracked by https://github.com/dotnet/razor/issues/8413

allisonchou avatar Sep 20 '21 23:09 allisonchou

Tracking issues: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1408466 https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1408465

allisonchou avatar Sep 23 '21 07:09 allisonchou

Other user asks: https://developercommunity.visualstudio.com/t/editorconfig-settings-for-razor-files-/1675953 https://developercommunity.visualstudio.com/t/editorconfig-not-applying-to-cshtml/10044204

allisonchou avatar Mar 05 '22 00:03 allisonchou

It's not even just editorconfig, but also just normal C# naming style settings

y2kbugger avatar Mar 24 '22 21:03 y2kbugger

Is this related to "Code Cleanup on Save" (https://devblogs.microsoft.com/visualstudio/bringing-code-cleanup-on-save-to-visual-studio-2022-17-1-preview-2/) not working for Razor files?

VS's "Format Document" command formats a Razor file, but saving a Razor file does nothing even with "Code Cleanup on Save" enabled.

(I'm using VS 17.2.0)

seangwright avatar May 16 '22 16:05 seangwright

This also related to https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1408493 (possibly a duplicate issue).

AllenD-MSFT avatar Jun 09 '22 23:06 AllenD-MSFT

Currently awaiting work on the Editor side: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1408466/ (Msft internal issue) https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1408493/ (Msft internal issue)

allisonchou avatar Nov 02 '22 22:11 allisonchou

Any update for the .editorconfig support ?

Kebechet avatar May 26 '23 15:05 Kebechet

Any update on .editorconfig support?

kuhnboy avatar Oct 18 '23 19:10 kuhnboy

No updates I'm afraid, we're still blocked on the VS editor fixing internal issue 1408493, which has been linked a few times here. I updated the main description of the issue with the status.

We are hopeful that the editor team will fix this in the next few months, but given how old this issue is, it would be pretty foolish of me to promise that (and of you to believe it 😛)

davidwengier avatar Oct 19 '23 02:10 davidwengier

I'm assuming this will be looked at in conjunction with the compiler rewrite that's underway? (At least the foundations for supporting it so that it can be supported quickly thereafter)

KennethHoff avatar Feb 25 '24 22:02 KennethHoff

Any chance of getting this sorted out in the .NET 9 timeframe?

epsitec avatar Jun 25 '24 08:06 epsitec