In Visual Studio, when I press Enter, it automatically indents my text, and I don't like that. Is there a way to turn that 'feature' off?
Tools->Options->Text Editor->C#->Tabs->select none under Indenting or change the tab size to 0
Try changing:
Tools -> Options -> Text Editor -> C# -> Tabs -> Indenting
To "none"
Related
I like intellisense however I don't like how when I finish typing something like a method name that has the name "Press" tries to autocomplete to "buttonpress" and when I press space bar to go to the next word or part of the code, it autocompletes to that and it's super frustrating. Is there any way to disable pressing spacebar for autocompleting but keep Tab to autocomplete?
Edit: I found the way to disable Enter or Tab for this (acceptSelectedSuggestion), but it doesn't list Space as one of the buttons that accepts the autocomplete suggestion.
Go to File -> Preferences -> Settings -> Text Editor -> Suggestions -> Quick Suggestions -> Edit in settings.json and add this line
"editor.acceptSuggestionOnCommitCharacter": false
I'm using Visual Studio 2008 and I have just noticed that the debugger is displaying integer values as Hex when I hover over variables and also in the immediate window. I guess I must have hit a shortcut key accidently or something.
Anyone had this before? How do I set it back to display in decimal?
Right-click your Watch Window or Immediate Window and uncheck Hexadecimal Display option.
You can also choose hexadecimal or decimal display on a per-variable basis in the Visual Studio watch window by appending a debugger format specifier to the variable name. In the watch window, enter:
myInt,h
myInt,d
The other very useful format specifiers are ac (see footnote) for 'always calculate', and nq for displaying with 'no quotes.' They can be used together:
my_string_func(),ac,nq
nq is useful inside DebuggerDisplay attributes, which can appear on a class:
[DebuggerDisplay("{my_string_func(),nq}")]
class MyClass
{
/* ...example continues below... */
...or on one or more field(s) inside a class:
[DebuggerDisplay("{some_field,nq}", Name="substitute name here")]
int an_integer;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
String some_field;
}
http://msdn.microsoft.com/en-us/library/e514eeby(v=VS.100).aspx
note that earlier versions of the MSDN doc page incorrectly said 'Ac' (with a capital 'A')--which doesn't work
There is a Hex button shown when Visual Studio is run in Debug mode to enable/disable the Hex display
Right-click on client space of almost every debug window (except Immediate Window) - watch/locals/autos/threads/call stack - and uncheck "Hexadecimal Display" option.
There's also a "Hex" button in debug toolbar (right to "Step Over" by default) when debugging.
In Visual Studio 2010 I also saw it in the Debug toolbar, it was highlighted in yellow 'Hex', I just clicked it and it returned to (normal) decimal values
Visual Studio 2017
Decimal vs. hexadecimal display is controlled only from the Watch dialog.
Break after setting the variable.
Right mouse click the variable and select "Add Watch" or "QuickWatch"
Right mouse click the line in the Watch dialogue.
Uncheck "Hexadecimal Display"
The display will now be in decimal.
In the immediate window you can uncheck the Hexadecimal Display option.
When you hover over a property in VS it shows the datatype and the origin/name.
I would like it to show a description.
///<summary> only works in the intellisense when you browse your properties.
The ComponentModel.Description data attribute only works in the intergrated VS property window (IDE thing or what ever).
Is there a 3rd option to get to show it on mouseover?
If not, is there maybe a setting in ReSharper that does the trick?
You can try ReSharper > Options... > Code Inspection > Enable code analysis ON and Color Identifierts ON, this will replace VS tooltips with R# tooltips...
When I press enter, it reposition the braces. How can I stop that? I want VS to keep automatically adding a closing brace after I type an opening brace, but I don't want it to move the brace on enter. How can I do that?
In Visual Studio 2013, you can change that option by doing the following:
Go to menu and select: "Tools|Options"
Select node "Text Editor"
Select node "C#"
Select node "Formatting"
Select node "New Lines"
Uncheck "Place open brace on new line for... " whatever you don't want the opening brace to be moved down to the next line for.
Select "OK button"
This is the automatic behavior styling. This means if you copy/paste, or complete a block, if your "format on paste" option is option, VS will restyle the pasted block. If your "format block on completion" option is on, it will restyle the block (putting the opening brace where the style demands it).
From your comments, it seems you should be asking "How do I turn off style enforcement?" or "How do I only enforce brace style on if blocks?"
You could go into "Tools|Options|Text Editor|C#|Formatting|General" and uncheck the Automatically format options to prevent the enforced styling whenever you paste, complete a block by typing }, or ;, but it won't stop all the automatic restyling in the Visual Studio editor when editing C# file types.
There isn't a setting that I am aware of to leave it on the line that you typed it (since most groups establish coding style standards that would state to put the opening brace should always be on the same line or always on the new line).
You can get VS to "forget" what it is supposed to do with a brace by moving the cursor outside of the brace block. So if you leave the Options >> Formatting setting checked (so it would normally put the brace on the next line) you can get the opening brace to stay on the same line by hitting RIGHT ARROW, LEFT ARROW, ENTER (i.e. move the cursor past the end brace, then move it back between the braces, then enter a new line).
Not what you wanted, but that's the best I can think of.
I don't know whats combination of keys I performed, but now my code looks like this, with a bunch of dots!
How do I disable this? Been looking for some time and can't find it.
this shortcut will do it : Ctrl+R,W
Or the slow way : Edit -> Advanced -> and uncheck "View Whitespace"
Press CTRL + E,S. This toggles the dots.
Edit
Advanced Options
View White Space