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.
Related
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.
This question already has answers here:
How to turn off CodeLens-References
(4 answers)
Closed 3 years ago.
How to turn off types hints in Visual Studio 2019 C# code editor?
Thanks to the comments on the question I managed to find out this is the R# option is called 'inlay hints' and it can be configured and turned off in resharper option menu.
VS -> Tools -> Options -> Resharper Ultimate -> Options -> Environment -> Editor -> Inlay Hints
I guess you're using ReSharper. And this hints are called Inlay Hints
This question already has answers here:
Unity Scripts edited in Visual studio don't provide autocomplete
(35 answers)
Closed 4 years ago.
I've been trying to get the intellisense autocompletion to work with Unity, but after a day of trying to make it work, no solution. Using C#
I'm not asking to solutions on this problem, but to ask where the documentation is found
Solution: #John
https://docs.unity3d.com/ScriptReference/Transform.html
This has all the scripts/functions that intellisense gives you.
Check THIS. You can find everthing there. For example, if you want to implement method from MonoBehavoiur use Ctrl+Shift+M or use Ctrl + Space with all suggestions.
This question already has answers here:
Is it possible to replace to uppercase in Visual Studio?
(3 answers)
Closed 9 years ago.
Is there a command or an addin in Visual Studio 2012 that would convert a selected piece of C# source code from SOME_NAME to SomeName?
I use resharper 7.0. It has rules on naming conventions so when I have stuff named SOME_NAME it will let me know and It will change it to the name based on the rule convention.
it will also apply naming convention to change that variable name to the code in which uses it.
I have no idea if resharper will do it all for you at once though. I've only used it for one off stuff.
When I had to do this in the past, I used the following steps:
Select the text OME_NAME and press Ctrl+U (convert text to lower case).
Select the text _n and type N.
Press Alt+Shift+F10 (show smart tag) to apply a rename refactoring.
Short answer no, but You can do a macro and use it or use some productivity tools as resharper.
As far as I know the only built in case shortcuts are to change to all uppercase or all lowercase. Here's the MSDN documentation for the case shortcuts in Visual Studio 2012: http://msdn.microsoft.com/en-us/library/ms165341.aspx
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
C#: Declare preprocesor symbol (like DEBUG) globaly for whole project
Can I set up a #NOTEMBEDDED definition in a project so that when I'm debugging and I hit a
#if NOTEMBEDDED
#endif
in various source files it will acknowledge it and fall into the if statement?
Add it to the project settings, right-click on the project, select Properties, under the Build tab there's a "Conditional compilation symbols".
You enter your conditional there.
Go to the Build tab in Project Properties and add it to the Conditional compilation symbols box.