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
Related
In VS 2013, I use the Selenitic color scheme. When importing it in VS 2015, I see some differences.
VS 2013:
VS 2015:
There are some differences (interface color, XML comment color), the thing that annoys me the most is that the XML comments in 2013 are nicely colored and in 2015 it is all the same color. I also noticed that xml comments are using a different color. I like the syntax highlighting in 2013, the XML comments are more subtle there. Is there a way I can fix this?
I found that some names of the elements in a .vssetting file have been changed. So, you need to rename them to the new ones to import it correctly. Here's the list of changed names which I found so far.
Old Name -> New Name
---------------------------------------------------------------------------------------------
Brace Matching (Rectangle) -> brace matching
String(C# # Verbatim) -> string - verbatim
User Types -> class name
User Types(Enums) -> enum name
User Types(Interfaces) -> interface name
User Types(Delegates) -> delegate name
User Types(Value types) -> struct name
Line Numbers -> Line Number
Razor Code -> RazorCode
XML Doc Comment -> xml doc comment - text
XML Doc Tag -> xml doc comment - delimiter
xml doc comment - name
MarkerFormatDefinition/HighlightedReference -> MarkerFormatDefinition/HighlightedReference
MarkerFormatDefinition/HighlightedDefinition
I believe this is not all, but at least it includes the missing colors you showed.
This doesn't specifically fix the import of a scheme, but the XML comment colors (in VS2015) can be manually changed
Assuming the following comment block
/// <summary>
/// Description
/// </summary>
/// <param name="test">Value</test>
/// <returns>Result</returns>
Go to Tools / Environment / Fonts and Colors:
There are a section of options all starting with "XML Doc Comments - ". Change each of these to change the corresponding part of the comment.
Delimiter: /// < < /
Name: summary, param, returns
Attribute Quotes: "
Attribute Name: name
Text: Description, Value, Result
I cannot find an option to independently color "test" above - it appears to be linked with "Identifier".
I'm pretty annoyed with the color changes. So far, I've found that Visual Studio 2015 has these differences:
Added new items (Display items) in the list
Split a single item into multiple items, some with a different color than before
User Types. Enums, Interfaces, and Type Parameters have a more pale green. Old color: rgb(78,201,176)
Changed default colors for some items
All comments were made a brighter green. Old color: rgb(96,139,78)
(Note that there are 8 different items relating to comments: Comment, CSS Comment, HTML Comment, VB XML Literals - Comment, VBScript Comment, XAML Comment, XML Comment, and XML Doc Comments - Comment.)
Identifiers (e.g. JavaScript code) made dimmer. Old color: white
HTML Entities changed to some blue-ish color. Old color: silver
more...
Note that the colors listed are defaults for the "Dark" theme, with the "old colors" being listed from Visual Studio 2012. The differences above are the most noticeable differences that I saw, since I wanted to change the JS color and the comment colors. There are probably others I haven't noticed yet.
If you need more help, this answer was also somewhat helpful for me.
Simple solution: avoid VS all together for theme management.
I agree with #Brandon on this. Backward incompatibility for font settings is insane for Microsoft and, unfortunately, a poor first impression for many of us when we upgrade to a new VS version. Just don't use VS for theme management (yes, it should just work, but after all Microsoft is focused on delivering more innovative features than making our IDE's look pretty).
Luke Sampson at Studio Styles (https://studiostyl.es/) does an amazing job keeping look & feel consistent while dealing with all the annoying label changes and other mappings that beak cross version setting export/import. Takes some time for the initial set up but after that you can export the version you need. Best part, it works...
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.)
Using VS2010 I wanted to turn on line numbering.
I went to:
Tools -> Options -> Environment with the intention of going to "All Languages" but the option wasn't there - neither was there an option for C# (which was the environment I specified at installation).
So I thought I just need to click "Show All Settings" in the bottom left corner... but it's not there.
All I really want is to turn on the line numbers but I'm kind of stumped without the right options being available.
Can anybody help with this?
From MSDN
To display line numbers in code
1.
On the menu bar, choose Tools, Options.
2.
In the categories list on the left side of the Options window, expand the Text Editor node.
3.
Perform one of the following steps:
◦ To set this option globally, expand the All Languages subfolder.
Depending on your language or setttings, you may also need to select the Show All Settings check box in the Options window to reveal the All Languages subfolder that this procedure mentions.
◦To set this option for a specific language such as Basic, C#, F#, open the subfolder for that language.
4.
Choose the General option.
5.
In the Display section, choose Line numbers.
you can turn on the Line number by going to:
Tools>Option>Text Editor>All Languages> General> mark the the Checkbox of Line numbers as Checked.
Tools -> Options -> TextEditor -> AllLanguages
For C#
Tools -> Options -> TextEditor -> C#
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
Is there a way to make Intellisense(CTRL+Space) automatically open after I type a letter? Its really annoying me to have to press CTRL+Space every line of code
What you describe is the default behavior. To restore it, use:
Tools -> Options -> Text Editor -> C# (e.g.)
Statement Completion -> Auto list members: Checked
Edit:
In C++ "Auto list members" does not apply to the first identifier in an expression, that is, when the identifier could be almost anything: a global variable, a keyword, a class member, etc. It does however apply (and does work) after the ".", "->", and "::" operators.
A workaround for a very common case of desiring auto listing for class members is to use the "this->" convention in your code, which some coding standards recommend anyway. The completion list will pop up immediately upon typing "->".
Default C++ IntelliSense does not open automatically when you are typing except for after ., -> and ::. The third party commercial extension Visual Assist X does provide that behavior though.