Visual studio no collapse / expand option [duplicate] - c#

This question already has an answer here:
Visual Studio 2017 does not show collapse icon for js file
(1 answer)
Closed 2 years ago.
Im using visual studio community and i cant collapse / expand parts of my code anymore. The plus / minus symbol is just gone. So now i cant collapse functions, loops etc.

Go to Settings and set
"editor.folding": true
"editor.foldingStrategy": "auto"
"editor.showFoldingControls": "always"

Related

Visual Studio Code - Why is it removing my indentation? [duplicate]

This question already has answers here:
How to prevent VS Code from auto-deleting tabs on an empty line?
(2 answers)
Closed 1 year ago.
I have this problem that Visual Studio Code doesn't detect indentation properly when moving around with cursor, and actually removes indentation automatically that I have manually added.
Why is it doing this? How do you configure it? Can't seem to find the setting!
Maybe is one of your extensions, have you tried to disable some of then to see if helps ?

VS Code C# XML Documentation [duplicate]

This question already has answers here:
XML Auto Commenting C# in Visual Studio Code
(3 answers)
Closed 8 months ago.
I'm on Visual Studio Code and I'm wondering what the shortcut is for creating documentation in C# for functions, variables, and classes since in VS Studio it's just pressing / three times.
Update Dec 16, 2020
This is now included in the default c# extension as of v1.23.8
You'll have to go to Preferences > Text Editor > Formatting and enable Format on Type
Or add the following in your settings.json file:
{
"editor.formatOnType": true,
}
Then adding three slashes /// above a member will auto-generate the XML doc comment.
I didn't find any shortcuts in VS Code. I tried search on Stack but it gave me "how to toggle the function comment on hover".
I looked up on the extensions and saw this
https://marketplace.visualstudio.com/items?itemName=k--kato.docomment
It works similar to Visual Studio where you have to press / three times.

Typing "ctor" to create constructor [duplicate]

This question already has answers here:
How do I generate a constructor from class fields using Visual Studio (and/or ReSharper)?
(12 answers)
Code snippet or shortcut to create a constructor in Visual Studio
(17 answers)
Closed 5 years ago.
I've seen a video here where a coder types "ctor" at 4:42, and the IDE automatically creates a constructor for him.
I tried to do the same, but for me, the IDE doesn't do that. IntelliSense does offer "ctor", but when I select it, nothing happens.
What is the trick that I'm missing?
Can you please check your Code Snippets Manager (Ctrl + K, Ctrl + B) if there are Visual C# file in Csharp language?
Code Snippets Manager
Go to menu Tools → Options → Text Editor → C# → IntelliSense, under the Snippets behaviour section: Make sure "Always include snippets" is selected.

Visual Studio 2015 debugging annoying boxes [duplicate]

This question already has answers here:
What are the two numbers in top left of uap app using VS2015 and Windows 10?
(3 answers)
Closed 6 years ago.
I'm developing a universal windows app in vs 2015 (C#)
When I run the application, two little black boxes with white numbers are always blocking my way (I can't see my app behind), these boxes are located in the top-left and the top-right of the window
Please tell me what are these boxesand how to get rid of them??
thank you
I have never seen or used these counters, but a quick Google search shows that they are Visual Studio Frame Rate Counters that are used for debugging purposes.
Apparently you can disable them with the following code in your app. I have no tested this so I make no guarantees to whether it works or not.
Here is a good article that describes this functionality though and shows the exact boxes you are describing:
http://www.kunal-chowdhury.com/2015/12/uwp-frame-rate-counter.html#fqDguKy73ZwohOYh.97
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = false;
}
#endif
Hope this helps.

Run to cursor in VisualStudio 2012 [duplicate]

This question already has answers here:
What is the shortcut key for Run to cursor
(4 answers)
Closed 3 years ago.
I can not see the Run To Cursor in VS 2012 when I am developing in C#. I checked the tool bar and also DEBUG menu and in both places there is no such entry. Where can I find this option.
You can still use the keyboard shortcut Ctrl+F10. Otherwise you can right click on the line you want to run to and select Run to cursor.
You can add the button to the toolbar by selecting Add or Remove buttons on the Debug toolbar and then selecting Customize.

Categories