Visual Studio code formatter

前端 未结 5 1244
情深已故
情深已故 2021-01-13 00:09

I\'m using Visual Studio 2008 for doing work in C# and JavaScript (AJAXy stuff).

Here\'s my issue -- I love Eclipse and especially the code formatted (Ctrl-Shift-F).

相关标签:
5条回答
  • 2021-01-13 00:33

    Here is a work around for visual studio: I just rename the extension to .css, right click inside the document and select "format document" and rename it back to .js, format is pretty good.

    0 讨论(0)
  • 2021-01-13 00:37

    Go into Tools | Options | Text Editor and edit the language specific settings to you're liking. Ctrl-K, Ctrl-D honors these settings, so you can make the code formatter working the way you want. There are a ton of options you can change (bracket positioning, spacing, indenting, etc.).

    0 讨论(0)
  • 2021-01-13 00:40

    go to options > environment > keyboard, find the command Edit.FormatDocument and bind that to ctrl + shift + f

    EDIT: Misread, you can configure how VS formats in options > text editor > (document type).

    don't know if you can get it exactly as how eclipse does, but that's where you set your preferences.

    0 讨论(0)
  • 2021-01-13 00:41

    I use the great Resharper plugin to format my C# code. Lots of settings to change to format your code to your liking. Can even make one coding standard with Resharper to be used by all your programmers.

    As for key bindings, can change those in your options.

    0 讨论(0)
  • 2021-01-13 00:43

    I have not tried but Resharper has lot of formatting and coding related nice stuff. May be you can find something useful there, and you may start loving VS as well.

    Note: Resharper on VS2005 was kind of sluggish.

    0 讨论(0)
提交回复
热议问题