Is it possible to customize the syntax highlighting in Visual Studio 2005? Up to now, I found no way to do this.
In eclipse for example, it's possible to setup custom highlighting.
Do you mean more than just changing the colors -- like defining a new language with its own symbols and keywords? If so,
http://msdn.microsoft.com/en-us/library/bb165041(VS.80).aspx
Yes, see Tools...Options....Fonts and Colors.
Here is a theme gallery if you want to browse some options.
For C++, you can add a file called usertype.dat that contains your list of custom keywords.
This MSDN page has a few more details.
This is an great free library: http://studiostyl.es/
Import the settings Via Tools->Import/Export Settings
Related
In previous versions of Visual Studio I've had knockout.js syntax highlighting.
Since moving to Visual Studio 2017 Community building in Razor however, the syntax highlighting is gone and I found no way to enable it.
Interesting is however, that when I put the very same code into project built on Webforms, the highlighting seems to work at least to some degree
Is there anything I can do to enable syntax hightlighting for Razor? And/Or is there a way how to make custom syntax highlighting rules? [e.g. highlight specific data attribute, or so]
Try this. Also Read the overview.
https://marketplace.visualstudio.com/items?itemName=ms-madsk.RazorLanguageServices
Yes, in our Project we added the file reference on the _references.js file:
/// <reference path="knockout-3.4.0.debug.js" />
This make Visual Studio Intellisense to get the sintax hightlighting on the .cshtml files.
Reference Directives
A reference directive enables Visual Studio to establish a relationship between the script you are currently editing and other scripts. The reference directive lets you include a script file in the scripting context of the current script file. This enables IntelliSense to reference externally defined functions, types, and fields as you code.
Sources:
MSDN - JavaScript IntelliSense
C# Corner - Use of _references.js File
Mads Kristensen - The history behind _references.js
My team wants to share our code styling and formatting.
We've been using Resharper for this and wanted to take advantage of the new native features in VS2017! What is the best way to do this?
.editorconfig!
Visual Studio 2017 will now respect settings from a .editorconfig file if it exists on disk, up to the project root. Currently this is supported on a per-project basis, not on a solution level (I believe R# may have supported this in the solution folder).
Almost every editor in VS should support basic editorconfig options, such as:
indent_style
indent_size
tab_width
end_of_line
Additionally, some languages also provide support for language-specific style guidelines. For .NET, see here.
Specifically for C# or VB, if you've configured your settings in VS Tools-> Options, there is also an option to generate an .editorconfig file capturing those settings:
Use this extension to generate code style and formatting options that integrate with your source control to effortlessly share solution-level settings.
https://marketplace.visualstudio.com/items?itemName=SchabseSLaks.Rebracer
I am using dynamic objects in a project, and I'd like to provide intellisense for the object. I understand that Visual Studio can't know what to show for intellisense, but if I can plug into the intellisense, I do know what entries should show up.
Is there a way to extend Visual Studio's intellisense? If so, any pointers?
Thanks!
You can use Editor Extension Points.
You can find specific information for extending Intellisense near the bottom of this page:
Editor Extension Points
From this page you can get information about ICompletionSource and ICompletionSourceProvider which are the two interfaces you must implement to provide autocompletion.
I would like to have Visual Studio highlight the names of my own classes in the text editor.
I have selected a color under User Types in Options > Fonts & Colors -- but strangely, this only works for Visual C# but not Visual C++.
Any ideas what's going on?
EDIT: I received some great tips regarding 3rd party tools in response to my previous question, but no answer as to why Visual Studio wouldn't provide this capability, or how to properly set it up.
Have you looked at Tools > Options > Environment > Fonts and Colors?
There's the following "Display items:"
User Keywords
User Types
User Types (Delegates)
User Types (Enums)
User Types (Interfaces)
User Types (Value Types)
This MSDN page details how to define the keywords. Basically create a file called usertype.dat with each keyword on a separate line, place it in the same directory as devenv.exe then restart Visual Studio.
Disclaimer: I haven't tried this in the latest versions of Visual Studio myself.
I gather that the answer is that Visual Studio simply doesn't provide comprehensive syntax highlighting for C++. Pity.
Is there a way to have Visual Studio 2008 automatically add heading information to files? For example, "Copyright 2008" or something along those lines. I've been digging through the options, but nothing seems to be jumping out at me.
I assume you'd like to modify the class file templates. They're in:
%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033
More specific details here
I found a better solution than modifying the template file directly. This utility allows you to create and save header/footer templates and apply them to entire source trees.
C# Header Designer from MSDN Code Gallery