Code color code and highlighting for unity - visual-studio

I have just starting learning how to make games in Unity, using Visual Studio as the Script Editor, I see other people have their Code colour coded and it also has auto completion.
I've followed some tutorials online but nothing has worked for me.
what do I have to install to get it working?

To add auto-completion you have to add the unity visual studio package. To add this package please type in your windows search field: "Visual Studio Installer" and then click at the visual studio version the button "change". After that, a new window opens in this window click the field with the unity package and then install this package. Now you have auto-completion in Visual Studio.
To add colors look this video: https://www.youtube.com/watch?v=_g1TyAGk6Lk& I really recommend this color theme.

The Color Coding of Code can be found on the Tools>Options>Environment>Fonts and Colors. For example, you want to change the color for the Operators (+, -, /, *, etc.), you would need to find it in the Display items List and edit (found on the Right Side of the Display Items) the color of the foreground (the text itself), it's background or whether it is displayed in bold or not.
I believe that auto completion or IntelliSense is on by default as for what I have Experienced in switching from MonoDevelop to Visual Studio 2017.

Actually, i think you're looking at a popular visual studio plugin called Resharper;
https://www.jetbrains.com/resharper/
It also has a Unity3D plugin (for resharper) which adds full support. That's were the coloring and extra intellisense comes from.
You can see some sample pictures here; https://github.com/JetBrains/resharper-unity

Related

Where is the documentation on Visual Studio's decorators?

Note: This is not for Visual Studio Code, but for the full version of Visual Studio.
When developing extensions for Visual Studio Code, there is something called Decorators, which can add icons next to each line of code.
I'd like to do the same, but for Visual Studio instead. However, I can't find anything by the name "Decorators" in the documentation. Is it even called that within the full Visual Studio?
Can anyone point me in the right direction?
More specifically, I am interested in making an extension that can produce the icons seen here, and I am unsure what these icons are called in the scope of Visual Studio:
Vertical part where icons are shown is called "glyph margin" and icons in it are called "margin glyphs". Provided link will lead you to a MSDN walkthrough to create your own glyph for a line that has a "todo" text in a comment.
I found a sample that describes it pretty well:
https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/Todo_Classification

Visual Studio extension: How to make editor text behave like a link

I would like to write a Visual Studio extension, that makes a part of the text behave like a link: blue, underlined on hover, open a URL on click. (Like the default editor works for http://... texts.)
I can do classification (coloring) and also custom adornments and commands, so I could probably make this "manually", but I wonder if there is an easier way to do that.
I am interested to do this in normal Visual Studio (2017 or newer), not VS Code.
You can use UrlTag.
On how to use tags see Walkthrough: Highlight text and Visual Studio 2017 Extension development tutorial part 5: Highlight code in Editor.

Class names not coloured in Visual Studio 2012

I am evaluating Visual Studio 2012 and am having some problems with the color schema.
Sure enough I was able to overcome the initial discomfort by setting my color for the text editor.
One thing I have not been able to set corrent are the color for the class names.
Say you have a line like below.
Class name = new Class();
the entire line is in the same color, expect the new keyword.
I want the word 'Class' to be in a different color like in earlier versions of Visual Studio.
I am not able to set the color for this from the Option.
I have tried chaning color for all fields like plain text, literals, identifier, etc under
Tool -> Option -> Environment -> Font & Colors
but still I am not able to fix this.
I have also applied custome themes, those are also not helping.
I wouldn't want to install a productivity power tool for such basic preference right ??
Edit:
I'm on Windows 7 x64 and Visual Studio Professional 2012, Version 11.0.50727.1 RTMREL
The solution I found is a combination of the suggestions found in a mish mash of related threads:
Close Visual Studio and open the VS command prompt as an administrator. Navigate to the devenv.exe file (in Express versions it is titled something along the lines of *express.exe) usually located in C://Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE.
Type devenv.exe /setup
Reopen Visual Studio. If everything is all colored now, great! If not, close the tabs and reopen them.
Performing all of step 3 is what has got my coloring to come back to normal.
Here is where I got the suggestions:
Visual Studio 2012 - Intellisense sometimes disappearing / broken
How can I get user type C# syntax highlighting working again in VS 2012 RC?
If you're using Productive Power Tools, go to => Tools -> Options -> Productive Power Tools. In main menu, TURN OFF the option: Colorized Parameter Help.
I solved my problem, I'm on Windows 8 Pro, Visual Studio 2012 Ultimate.
You're on the right track. Under Tools -> Options -> Environment -> Fonts and Colors, you want to change "User Types", first making sure at the top of the dialog that you are viewing the settings for the "Text Editor"
Although, by default with my install of Visual Studio 2012 these were already set, so you may want to try the "Use Defaults" button, unless you've made other changes that you want to keep.
go to the tools >Option click on enviroment navigation and click on import and export setting and copy the url and open directory from the url and delete all font and color file .which you got setting folder
The workaround provided by Donatas on Microsoft Connect works without having to turn off any option of Productivity Power Tools:
There is a workaround without turning off "Colorized Parameter Help".
Go to Tools > Options > Environment > Fonts and Colors in Display
items select "User Types (Value types)" click Custom next to Item
foreground color and in the color picker change Red, Green or Blue by
1, i.e. to make a custom color which basically looks the same. OK on
all the dialogs and problem solved.

Is there plugins/addons for visual studio 2010 to change the code and text editor's background color?

I have been looking for , lets use the word "mods", for visual studio left and right to be able to change the background and font color of the code editor for quite a while now. This is a simple question and hopefully not a duplicate of Is it possible to change backround color of editor and autocomplete tooltips in Visual Studio?. If I can refine my question a bit more, is it possible to manually change the background color of the code and text editor, or does mods or plugins or addons exist somewhere to do this feature for me? My eyes are straining on the white background...
I am using visual studio 2010
From the main menu, go to Tools -> Options. From there open up Environment -> Fonts and Colors. If you don't want to spent the time configuring it that way (which would be completely understandable), download the theme editor, or pick and download a nice theme at http://studiostyl.es/

Highlight all references to X?

The Eclipse IDE has a neat little feature that I really miss in Visual Studio.
If I place the cursor on a variable or method name, the IDE will automatically highlight all references to it in the current document within the relevant scope.
I can't seem to find an option to turn on similar behaviour in VS2008 or Resharper 4. I know VS has a Find Usages function, but I'd like to do it automatically on the fly.
Does anyone know of a free addin which will add this functionality?
If you're using ReSharper, you can highlight the usages in the file with Shift-Alt-F11. Place your cursor on the variable you want to find usages of, and press the Shift-Alt-F11 combination.
There is an add-in for Visual Studio that will do something similar called RockScroll.
When you double click on something, it will highlight all occurrences of the item you double clicked. It also changes the vertical scrollbar to a "syntax highlighted thumbnail view" showing an overview of where the item occurs in the file.
I know you mentioned ReSharper, but CodeRush has a nice references window that you can dock and let it search for things on-the-fly or on demand. As a bonus, you can select each usage and it will show you the context surrounding the usage. It also works for methods.
I mentioned CodeRush since they have an express edition, which looks like it includes that feature, but I haven't tried that edition.
Visual Studio 2010 has sorta implemented this, but the feature is somewhat lacking. There is a non-configurable delay between placing the cursor and highlighting.
The RockScroll Addin is not available for Visual Studio 2010 and above.
As a replacement, the free "Highlight all occurrences of selected word" plugin will highlight all occurences of the selected string after a doubleclick. There is no delay as with the native vs2010 highlighter.
It is string-based, which means it works inside comments and string literals.
Microsoft published a tool that sort of does what you want.
Some of my favourite features:
Enhanced Scrollbar
Auto Brace Completion
Ctrl + Click Go To Definition
Open Containing Folder
and the list goes on.
For Visual Studio 2010 and for Visual Studio 2012

Resources