dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
495 stars 191 forks source link

Add editorconfig support in Razor #4406

Open allisonchou opened 3 years ago

allisonchou commented 3 years ago

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
  2. Support for start C# editor config controls in document formatting, eg code style
  3. Support for razor specific editorconfig controls for formatting and other behaviours
allisonchou commented 3 years ago

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

allisonchou commented 2 years ago

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

y2kbugger commented 2 years ago

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

seangwright commented 2 years ago

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)

AllenD-MSFT commented 2 years ago

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

allisonchou commented 1 year ago

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)

Kebechet commented 1 year ago

Any update for the .editorconfig support ?

kuhnboy commented 11 months ago

Any update on .editorconfig support?

davidwengier commented 11 months ago

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 😛)

KennethHoff commented 7 months ago

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)

epsitec commented 3 months ago

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

davidwengier commented 1 month ago

Also reported at https://developercommunity.visualstudio.com/t/Razor-editor-no-longer-respects-tabsspa/10720119