Cutting to the chase:
Is there an option in VS or a plugin that can provide the ability to insert a line break after a certain amount of columns of a compressed/single line formatted Razor/HTML/ASPX page?
From:
To:
Tools -> Options -> Text Editor -> CSS -> Formatting
choose style: Compact rules
You can use resharper a visual studio plugin.
If you go to ReSharper -> Options -> Languages -> C# -> Formatting style -> Line Breaks and Wrapping
There is a host of options in there.
Tools -> Options -> Text Editor -> All Languages -> Word Wrap
or if you prefer:
Ctrl+E+W
Related
If I type if (true) Enter
the cursor will be indented like
and if I continue with { Enter }, I will get a brace layout like
Why?
I expect the braces to be like
In resharpers Braces layout section I have setup braces layout to be At next line (BSD style).
In visual studios options, going into Text Editor, C#, Code Style, Formatting, Indentation I have the checkbox Indent open and close braces checkbox unchecked.
How is it possible with two separate options sections for code style, both Visual Studio and Resharper? Who wins?
I think the solution is to:
go to Visual Studio Options -> Text Editor -> All Languages -> Tabs and set Indenting to Block, then
go to ReSharper Options -> Environment -> Editor -> Editor Behavior and make sure Smart Indent on Enter is unchecked.
I have a file from third party where the curly brackets were in the next line but today when i see, all the brackets are moved on the same line as function name.
i would like to revert back all at once, please help.
Thanks in advance,
Sagar
In the Top Menu
Tools -> Options -> Text Editor -> C# -> Formatting -> New Lines
there you find New line options for braces
I guess thats what you´re looking for
The question relates to where can one customise the rule set for the new Visual Studio 2015 Light Bulb or Quick Actions feature.
Specifically I want to disable the one imaged below, for "simplifying" String.IsNullOrWhiteSpace to string.IsNullOrWhiteSpace.
The warning message given is:
IDE0001 Name can be simplified.
Tools -> Options -> Text Editor -> C# -> Code Style
Then untick the following:
Prefer intrinsic predefined type keyword in member access expressions
I just ran across this terrible code:
string summary = Controls.BasePage1.GetLDA().ExecuteStringScalar(sb).Replace("'", "\\'");
It's not doing adequate null checks. Is there any way to detect long lines of code like this in a Visual Studio project?
Plain vanilla Visual Studio doesn't support search for long lines nor NullReferenceException checks.
There is an option to wrap long lines but it doesn't break lines to smaller units. (Tools -> Options... -> Text editor -> C# -> General -> Word wrap). If you widen your visual studio instance it will unwrap the line.
However, the functionality you are looking for is provided by third party plug-ins. I'm using ReSharper. It can find any possible NullReferenceExceptions in your code. Also it can automatically format your lines to whatever length you prefer. (Resharper -> Options -> Code Editing -> C# -> Formatting Style -> Line Breaks and Wrapping has quite a few options to fine tune code editing.)
How to change the highlight color of any matching element (function, quote or tag) in Zend Studio ?
Found the solution combining 2 similar questions and answers:
Where to change highlight color for selected occurrences in Eclipse?
Matching keyword highlight color in editor
So in Zend Studio you can do it like this:
Preferences -> General -> Editors -> Text Editors -> Annotations ->
There you can find different highlight coloring options