Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Write Extensions for the Visual Studio 2010 Editor

0.00/5 (No votes)
2 Dec 2009 1  
How to extend the Visual Studio editor to make editing code more pleasant and productive
Editor Extensions

Introduction

This article is part of my series on Visual Studio Extensions. Before you read it, please read the Introduction. It tells you the purpose of the series and gives you some tips on presenting my material. This article is designed to give you what you need to deliver a successful presentation. The speaker notes and demo script, along with the videos, are part of the package and you won't learn everything from just the text of the article. My goal is to increase developer awareness of Visual Studio Extensions by making it easy for anyone to deliver a presentation on them at a user group, code camp or the like.

Visual Studio 2010 has a whole new code editor and that opens a whole new set of doors for those who like to customize and make the tool their own. The new WPF-based editor can use a variety of fonts, backgrounds, images and gradients in the code area and both horizontal and vertical margins. This presentation shows a few editor extensions to inspire attendees, and walks through creating one extension. It also discuss the VSIX format, the Visual Studio Gallery, and how simple it is to share your extensions with the community.

Presenting this Session

This is a 300 level session for people who know what extensions are. Some of them will be using extensions, and they should be interested in learning how to write them. There is a small amount of material to get them to agree that extending the editor has plenty of benefits.

This session starts with background - what's different in the editor, what can you extend? Then comes some inspiration. You should probably play with the extensions that are mentioned in the deck. If you really want to demo them, check for time, because I timed this session without demo-ing the examples on Slide 6, and the other two are not very simple to demo. Besides, you really don't want any extensions installed when you're doing the real demos. But just because you're not going to demo them, you should still install them, play with them, know how they can change the way Visual Studio feels to you as a developer. Then uninstall them before you deliver the session.

I've recorded the individual demos so you can see how they're done and about how long they take. Once you know how to do these demos, you'll find the slides very easy to talk to since many of them summarize the points you made in the demo.

Demo 1 - Writing the Extension

I included Slide 10 and my talking to it before the demo, because I think explaining the architecture goes hand in hand with writing the code. It's about 20 minutes long. I have had to split it into two parts in order to upload it.

Demo 2 - Sharing the Extension

This demo has several small parts and you need to have the overview so you understand why you are popping over to something and then coming back to where you were. First you change the manifest, then show how there are now two extensions in the experimental instance and delete the old one. Then you browse to where the experimental instance looks for extensions to connect to the slide on that. While still outside of Visual Studio, you browse to the VSIX file for the demo extension, and show how it's just a zip. Then it's off to the Visual Studio Gallery both in a browser and from Extension Manager. You show the start of how to upload a vsix, and how to find the Visual Studio SDK. Finally you share your extension with yourself by copying the VSIX to your desktop and installing it. Luckily that's incredibly simple and quick. The whole demo runs about 14 minutes so there's a context switch every minute or two. Make sure you practice this one a lot so you don't get lost and skip a section. I have had to split it into two parts in order to upload it.

The Notes

Remember, you don't have to learn these just from the videos. There are detailed speaker notes and a demo script for you in the downloads for this article.

History

  • 1st December, 2009: Initial version

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here