I'm looking into Productivity tools for developing in C# / Visual Studio 2008 (pr0) and developing web apps (not using MVC).
Anything from favourite visual studio shortcuts to external tools and plug-ins.
Ctrl+. is one of my favorites. It adds a Using statement for the current class if you don't already have it.
For example if you have this:
Regex
And you hit Ctrl+.. Visual Studio will add
using System.Text.RegularExpressions;
to the top of your file.
I also like Code Rush and Refactor Pro from DevExpress.
A very interesting one that was just announced is Telerik's JustCode. It's basically a new refactoring tool (such as Resharper and CodeRush, also very good productivity improvement tools), but also handles Javascript in web projects.
Tools like these can dramatically improve the amount you can get done in a short amount of time.
ANTS Profiler from Red Gate helped our company find a lot of bottlenecks in our C# code.
Reflector from Red Gate PowerCommands visual studio add-in any form of Grep
We've just started using GhostDoc which is pretty useful for quickly generating outlines of comments especially when you're generating your documentation from your XML comments. It's definitely saved me some time.
its not a tool but a big reference chart - you can print it out and hang it on at your work area, to refer quick key bindings http://www.microsoft.com/en-us/download/details.aspx?id=7162
Related
Iam used to Eclipse and Java development, but because of my job I need to start coding in C#. I find it a bit annoying that visual studio doesn't autocomplete my blocks. For instance when I write a new function, class or statement am used to that the IDE autocompletes my blocks. So when I type:
private function sendData(String msg, String email) {
and hit enter the closing bracket appears automatically, is there any settings that enables this function in Microsoft visual C# 2010 express ?
This isn't possible with Express versions, since you can't install extensions. You'll need to use Professional or higher and use third party extensions. Some simple free ones will do this (such as Productivity Power Tools), as does the commercial product ReSharper, which does much more more. The later likely would make Visual Studio have other features that you're probably used to comming form Eclipse, such as more refactoring support.
I'm almost certain that the Productivity Power Tools extension will give you this feature. You can find it here:
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef
It's really a great add-on and it will give you a lot more control over options like this.
There is no functionality like this already built-in in Visual Studio, but you can install a plugin like Brace Completer to add the functionality .
No, you can't do it by default in Visual Studio. Visit Microsoft Connect to submit a feature request.
I want to write a new templating language, and I want Visual Studio to "support" it. What I need to know is:
How do I parse my new language?
Given some code in my new template language, how do I translate it into HTML? Right now I'm using regular expressions to parse it token by token, but I don't think this is going to scale very well as the language gets more complicated, and there's no error checking. I've heard of ANTLR but never used it. Would that be the right tool for this job, or is there perhaps something simpler? Ideally I'd like to send any syntax errors to the error window with as much information as possible (line #, type of error) like other languages do.
How do I create a new file type for Visual Studio?
How do I get syntax highlighting?
Can I use the same parser I created in step 1, or is this something entirely different?
How do I get Intellisense?
I'd prefer to write my parser in C#.
I would take a look at another language that has already done the legwork of integrating with Visual Studio. A great example is Boo. The language and Visual Studio integration are open source. So you can take a look at exactly what they had to do.
Boo Language: https://github.com/boo/boo-lang
Boo Syntax Highlighting for VS2010 (VSX add-in): http://vs2010boo.codeplex.com/
Boo Language Studio (syntax highlighting for VS2008): http://boolangstudio.codeplex.com/
The Boo Syntax Highlighting for VS2010 includes some recommended links on its homepage, which I'll copy for easy reference:
Nice article about "classification" (syntax highligting) in VS 2010: http://dotneteers.net/blogs/divedeeper/archive/2008/11/04/LearnVSXNowPart38.aspx
Examples for VSX add-ins: http://blogs.msdn.com/vsxteam/archive/2009/06/17/new-editor-samples-for-visual-studio-2010-beta-1.aspx
Regarding the Visual Studio aspects, what you need is a "language service", which is the entity that handles colorizing, intellisense, etc. for a given file extension/type.
For an intro, see this article
And for a code sample see here
Regarding parsing, there are lots of technologies, and I won't offer an opinion/advice.
Beware, there is a fair amount of work involved, although in my opinion it is much more straightforward in VS2010 than in previous versions of Visual Studio to provide this kind of extension.
See also
Visual Studio 2010 Extensibility, MPF and language services
I wrote a VS Language Service using this article as my basis:
http://www.codeproject.com/KB/recipes/VSLanguageService.aspx
It wasn't too bad if you have a basic handle on Grammars.
There is a sample in the VS SDK that shows most of the features you are looking for.
I was using VS with own language and desperately needed a syntax highlight. I built mine based on this tutorial: https://mattduffield.wordpress.com/2012/07/31/writing-a-brightscript-syntax-highlight-extension-for-visual-studio-2010/
I know the tutorial is in VS2010. I made mine in VS2012 with no or very small hiccups. (also worked in VS2013) Recently I changed to VS2015 and the solution can be edited, built with no problem.
I found this very useful collection of recent samples for Visual Studio 2013 SDK:
http://blogs.msdn.com/b/vsx/archive/2014/05/30/vs-2013-sdk-samples-released.aspx
It also contains the recent version of the OokLanguage which sounds promising.
We used ANTLR 4 to parse our language which works like a charm and allows direct interaction with C# code. Can totally recommend it.
As mentioned in other answers, the most interesting code sample is the Ook language extension for the latest version of Visual Studio (2017 at the time of writing).
For VS 2015 see the sample in the VS2015 branch.
In order to install the SDK for 2015 or later, you need to rerun the VS setup. In 2015 it's called "Visual Studio Extensibility Tools Update 3".
I'm writing an add-in for extending Visual Studio 2008 (adding custom functionality). While doing that I came across a situation where it would be good if I could provide custom messages via tooltips for any line of code.
Doing this IMO requires accessing the VS editor control and by some way displaying the respective tooltip. This might also be visualized like breakpoints that on mouse hovering provide a tooltip message.
Is this implementation possible? If yes, what's the way to go? If not, what similar way do you suggest?
In a recent episode of Hanselminutes, they discussed how much more extensible the VS 2010 editor is going to be. Based on what they said, I think it will be rather difficult (although probably possible) until they introduce that extensibility.
Yes it is. You can add more customization on the code editor of VS 2008, even you can create your own language service with your own intellisense support in VS 2008.
You can do this simply by using VS 2008 SDK, and you can also quickly play with the standalone shell of Visual Studio 2008, and MS SQL Server 2008 Management Studio is one example of customized Visual Studio standalone shell.
You can visit MS Visual Studio Extensibility:
http://msdn.microsoft.com/en-us/vsx/default.aspx
And lots of videos on VS 2008 SDK:
http://msdn.microsoft.com/en-us/vsx/bb507746.aspx#extensibility
You should take a look at Resharper and work out whether your add-in would be better suited to being a Resharper Plug-In. This approach would require your users to buy Resharper, but this sort of thing is exactly what it does.
For example, check out http://stylecopforresharper.codeplex.com/ where this sort of hint/tooltip stuff in Resharper is used to highlight lines of code that have StyleCop issues.
i want to convert my window application, that i developed in VS2005 using C#, as an Add in for Visual Studio 2005. How can i do it.?
There is a nice quick start tutorial in here : http://www.codeproject.com/KB/macros/LineCounterAddin.aspx
It was enough for me to start.
You could try looking at MSDN or books, but you might find the VS2005 information hidden behind the VS2008 stuff...
I wanted to create one myself, but i didn't have yet time to process the information required:
"How Do I?" Visual Studio extensibility videos
Article series detailing extending visual studio from the beginning:
LearnVSXNow!
Microsofts's VSX
Home on Code Gallery
Building your own Visual Studio Source Code Outliner extension (and Quan's whole blog)
Overall I'd recommend waiting for Visual Studio 2010 (or start working with the fresh beta 1), because there will be many changes and many more possibilities on extending Visual Studio. (Think WPF.) The code gallery I linked already contains content regarding to this.
I'm just getting started with C# and often find myself going back to other projects and reusing some snippet of code in a new project.
Is there a good tool out there with which on can store all the little pieces of code they reuse again and again AND integrates with Visual Studio Express??
Visual studio has the concept of code snippets, under the tools menu there is a code snippets manager.
Almost forgot, to bring up the code snipped menu in code press CRTL+K+S.
Visual Studio Express is not legally extensible so I doubt there is a tool you can purchase or download that will integrate. However, snippy will help manage and create standard .snippet files for you, without integration.
It sounds like you may want to develop your own little framework that can be referenced by various projects.