-
In an effort to help more people get started with Editor extensibility quickly and easily, we’ve recently posted some new code samples on the VS 2010 Editor. Each of the links below will take you to a sample, complete with description, instructions, and a download of all the code you need.
- ToDo Glyphs: Adds a visual glyph for ToDo items in a file
- Hyperlink: Enables Ctrl+click navigation to hyperlinks
- Diff Classifier: Provides syntax highlighting for diff/patch files
- Highlight Word: Uses tagging and adornments to highlight all occurrences of the word under the caret
- Caret Fish Eye: Transforms the text in the editor so it appears larger around your caret and smaller elsewhere



There’s also source code available for the RegEx Editor, Demo Dashboard, IntelliSense Presenter, and Image Insertion extensions, as seen on the Visual Studio Gallery and in the Extension Manager, so you can see how we implemented them :-) You can find all of these and a variety of samples from other teams at the VSX sample homepage – check back periodically because we’ll continue to add new content from now to the final release of VS 2010.
We’ve also heard some feedback that you want more documentation, so here it is: Beta1 Editor documentation. You’ll find walkthroughs on extensibility, help with MEF, a list of extension points, and more. It’s a great place to get started.
You can always get in touch with the Editor team by commenting on this blog, posting in our Beta1 feedback forums, or e-mailing us directly. Now there’s one more way to get Editor news and keep in touch with the Editor team: follow @vseditor on Twitter! We’re new to Twitter but are already tweeting about new samples, documentation, news, and all things Editor, so check us out!
Brittany Behrens
Program Manager, VS Platform Team
-
In an attempt to bring extension building to the masses, the editor team submitted a hands on lab for TechEd this year that walks you through creating a real-world extension. While one of the goals of the lab is to show you how to build extensions in general, the hope was to also disseminate some of the methodologies and concepts behind our new extensibility story.
Everyone has certainly seen the obligatory “Hello World” code for any new thing they try. I wanted the lab to be much more meaningful than that though, and instead provide you with a scenario that might be something you actually want to do. In this case, what you’re building is an extension that allows you to place walkthrough content directly inside of the editor in little chat-like bubbles.
All of the walkthrough steps you see here are actually parsed from an XML file, which means that this extension adds meta content to the editor window without any modification of the code file it is displaying. Moreover, there is also another kind of visual created here; a little block around the word “System,” which when hovered over will then display a tooltip with extra information. These two visuals are called “Adornments” in the editor world, and are nothing more than Windows Presentation Framework (WPF) elements associated to a grouping of text. Last but not least, the green bar across the top of the image above (that has a label with “Position:” on it) is called a margin. This is another WPF element, but this time it is snapped to the outside edge of the editor’s window.
So if you didn’t get a chance to make it to TechEd 2009, but would like to try out the lab, you’re in luck. It takes about an hour to complete (yes, you will be able to get all of that functionality done in an hour) and it takes the time to explain a bit about what you’re doing and why. I hope you find it useful, and look forward to the extensions you guys create!
Download Lab Files
Cheers,
Chris Granger
Program Manager | Visual Studio Platform
-
Thank you to everyone who has downloaded and tried VS 2010 Beta1 so far! In the two weeks since Beta1 was released, you’ve sent us tons of feedback that has helped us fix some of the most commonly reported bugs. This post details frequently-encountered bugs and their status, in no particular order:
Background Color of the Editor is always white
Status: Patch available for download here
The Bug: Setting a custom background color for the editor works once, but every new editor window opens with a white background. This can be fixed by going to Tools->Options->Environment->Fonts and Colors and simply clicking OK, but it’s annoying to have to do that every time you open a new tab or restart VS.
The Solution: This should be fixed for the next release of VS 2010. For Beta1, there is an extension written by a member of the VS Editor team as a patch that will allow custom background colors to persist. You can find it in VS by going to Tools->Extension Manager and searching for the "BackgroundPatchExtension," or download it from a web browser here. Once you install it, just make sure it is enabled in the Extension Manager, and your background color should be applied correctly.
Outlining Highlight Color flickers or makes text unreadable on dark backgrounds
Status: Fix in progress
The Bug: The highlight color when you mouse over an outlining region is not currently configurable, and the default color makes text difficult to read on dark backgrounds. Some users also notice that the highlight causes a flicker effect when moving the mouse from the editor to the toolbox, line number margin, breakpoint margin, or other margins on the left.
The Solution: We plan to choose a better default color that should make the highlight better for dark backgrounds. We also plan to make the highlight color configurable, so you can choose a custom color that works with your preferred color scheme. This also gives the ability to avoid the flicker by setting the highlight color equal to your editor background color. You should see these changes in the next release of VS 2010.
Some Fonts do not work, and Text in the Editor may appear blurry
Status: Fix in progress
The Bug: Some fonts, custom and available in Tools->Options, will display as Consolas instead of the desired font. Text in the Editor, tooltips, or IntelliSense may also appear blurry to some users.
The Solution: Because the new VS 2010 Editor is based on WPF, its font rendering has different advantages and limitations than the editor in previous versions. WPF supports only TrueType vector-based fonts, so selecting a bitmap or non-TrueType font will cause the editor to revert to the default font, i.e. Consolas. Some of the fonts in the Beta1 list in Tools->Options->Environment->Fonts and Colors are not TrueType fonts and will also not work, and we have now removed these fonts from the list for future versions of VS 2010.
We are also working with the WPF team to make significant improvements to the Editor's font rendering for the final version of VS 2010, which should reduce the blurriness of text in the Editor, tool windows, IntelliSense, and tooltips. In the meantime, it may help to run the ClearType tuning tool to improve font clarity in the VS Editor and other applications. You can also track the WPF team’s work on font rendering.
Mouse-Wheel Scrolling in the Editor is slow
Status: Fixed
The Bug: When using the mouse wheel, the editor scrolls very slowly or sometimes not at all. Other applications scroll as expected.
The Solution: The editor was not respecting system-wide settings for the mouse wheel as configured in the Control Panel. This has been fixed and should work correctly in the next release of VS 2010.
Scrolling with a Laptop Touchpad does not work
Status: Fix in progress by the WPF team
The Bug: When you try to scroll the editor with a laptop’s touchpad, nothing happens.
The Solution: None yet, but the WPF team is working on this issue. You can track its status here.
Editor does not scroll horizontally when selecting text with Ctrl+Shift+arrow keys
Status: Fixed
The Bug: When using Ctrl+Shift+arrow to select text, arrowing off the screen does not cause the editor to scroll horizontally. The caret goes off the screen, but you can’t see where it went.
The Solution: This has been fixed and should work correctly in the next release of VS 2010. The workaround for Beta1 is to use Shift+arrow instead of Ctrl+Shift+arrow or to select out-of-view text with the mouse.
Zoom: Scrollbars should not zoom, and there is no way to quickly return to 100% zoom
Status: Fix in progress
The Bug: When using Ctrl+mouse wheel zooming, scrollbars also zoom and quickly become too large or small. There is also no way to quickly return to 100% zoom.
The Solution: We are planning significant improvements to the zoom feature that should fix both of these issues for the next release of VS 2010. You can track these issues here and here.
Mouse Cursor becomes invisible
Status: Fixed
The Bug: When using Visual Studio, the mouse cursor sometimes becomes invisible, seemingly at random.
The Solution: We discovered and fixed a bug in the Regular Expression Editor extension, available on the Visual Studio Gallery or through the Extension Manager in VS. We believe that this bug is isolated to the RegEx Editor extension and is now fixed. If you downloaded v1.0 of the RegEx Editor it and are seeing this problem, please uninstall and reinstall it or use the Updates section of the Extension Manager to download the fixed version.
First item in a Smart Tag is not selected by default
Status: Fixed
The Bug: Invoking a smart tag by clicking on it or pressing Ctrl+. brings up the tag, but the first item in the correction list is not selected by default.
The Solution: This has been fixed and should work correctly in the next release of VS 2010.
Arrow keys do not move caret on wrapped lines
Status: Fixed
The Bug: When word wrap is enabled, pressing the up and down arrows may not move the caret.
The Solution: This has been fixed and should work correctly in the next release of VS 2010. For Beta1, the workaround is to disable word wrap or use the mouse to navigate away from a wrapped line.
Context Menu location is wrong
Status: Fixed
The Bug: Right-clicking in the editor causes the context menu to appear at the location of the blinking caret instead of the location of the mouse cursor.
The Solution: This has been fixed and should work correctly in the next release of VS 2010.
If you’re seeing other issues, please post a comment, check the Beta1 Editor forum, or file a new bug and we’ll investigate. Your feedback helps us find and fix bugs faster and improve Visual Studio, so keep it coming!
Brittany Behrens
Program Manager, VS Platform Team
-
Since VS 2010 Beta1 became publicly available last week, the Editor team has heard from quite a few users who miss box selection (aka column selection, block selection, or rectangular selection). Yes, it’s missing from the beta, but the good news is that it will be back and better than ever for the final release of VS 2010.
Not only will you be able to make, copy/paste, drag/drop, and delete box selections, but you’ll also have the new ability to insert and edit text on multiple lines. Check out this video we’ve created to demo the new Box Selection and Multi-Line Editing functionality (this demo has video and audio, so plug in your headphones or turn up the sound):
To those who miss box selection in Beta1: we hear you. Rest assured that it will be in the final release of VS 2010, and I hope you’ll find it even more useful than in previous versions.
Aside from box selection, there are a few bugs and issues that a lot of folks are seeing, so stay tuned for a post on other known issues in the Editor and possible workarounds. We’ve received a ton of comments, e-mails, and Connect bugs in just a few days, so if you haven’t received a response yet, don’t worry; you will soon. Above all, thanks for downloading VS 2010 Beta1 and sending your feedback – keep it coming!
Brittany Behrens
Program Manager, VS Platform Team
-
It’s official: Visual Studio 2010 Beta1 has shipped! Check out this page for the official product information or download it (free!) here.
So what’s new for the Editor in Beta1? We’ve made significant improvements since the CTP, including better stability and easier extension development. You’ll also notice the return of many of your favorite features:
- The redesigned Code Outlining feature that the Editor team and VS General Manager Jason Zander blogged about over the past few weeks
- The Track Changes margin, which uses colors to show the changes made in your file
- Drag & Drop code editing, copying, and pasting
- RTF cut/copy/paste, which allows RTF formatting to persist on copying and pasting text into another application
- Incremental Search (Ctrl+I), which refines your search terms as you type them
- Visible Whitespace (Ctrl+E, Ctrl+S), which shows visual glyphs for different types of whitespace, e.g. dots for spaces, arrows for tabs
- A new default font, Consolas, specifically designed for working with code
And that’s just the Editor. In the VS 2010 Beta, your window layout is more customizable than ever with floating document tabs and expanded multi-monitor support in the VS Shell. You can search for project templates, find new templates online, and download content from the revamped New Project Dialog. You can even use the new Extension Manager to download extensions from within Visual Studio and publish any extensions you write. The list of improvements goes on and on – for more details about what’s new for Beta1 in VS Platform and beyond, take a look at JasonZ’s screenshot-filled blog post.
Now that Beta1 is available for download, there are a few frequently-asked questions:
Q: Is it ‘safe’ to install VS 2010 Beta1 on my machine?
A: Yes! We’ve tested side-by-side scenarios, so installing the beta on a machine with VS 2008 installed is fine. The beta also supports uninstall and should leave VS 2008 and your machine in working order afterward. You can install VS 2010 Beta1 on a VPC if you prefer, though you will notice slower performance than if you run VS on your local machine. And please remember that however you install, this is pre-release software. The VS 2010 Beta1 readme documents major known issues, but it’s not guaranteed to be an exhaustive list.
Q: Can I install on Windows 7?
A: Yes! Installation of VS 2010 Beta1 on the Windows 7 RC is supported, so go right ahead. We don’t recommend installing Beta1 on the Windows 7 beta, though, so please upgrade to the Win7 RC before installing VS 2010.
Q: Is there a VS 2010 SDK?
A: Yes! It’s available for download here. I highly recommend the SDK, as it includes a lot of additional documentation and sample code. It’s a great place to get started with Editor extensibility.
Once you’ve downloaded the VS 2010 Beta, we’d love to hear from you! You can post feedback on the Beta1 forums or file a bug for any problems you find. And as always, you can contact the Editor team directly by posting a comment or using the Email link. No matter how you do it, I hope you’ll let us know what you think.
Enjoy the Beta!
Brittany Behrens
Program Manager, VS Platform Team
-
One of our goals for the new editor is to make extensibility easier and more powerful than ever before. From custom text coloring to visual adornments painted directly on the editor surface, extensibility can dramatically change and improve the development experience. A recent article written by Lisa Feigenbaum, Microsoft’s Program Manager for the VB Community, showcases an adornment that enables rich WPF-based visualizations of XML doc comments:
You can read Lisa's entire article, titled “Documenting Your Code With XML Comments,” in MSDN Magazine. It not only highlights how this extension can transform the way developers read their code but also shares helpful information and tips about doc comments in general, so I’d encourage you to take a look!
Brittany Behrens
Program Manager, VS Platform Team
-
We heard your feedback on the new editor’s code outlining feature, and we now have an updated design to share. It brings back the familiar +/- icons from VS 2008, but with some updated styling and additional functionality:
- The current outlining region is highlighted on mouseover, so it’s easier to tell exactly where each region begins and ends.
- Expanded regions can be collapsed from anywhere in the region. You can still click on the - glyph to collapse, but you can also double-click anywhere in the outlining margin to collapse a region.
- Mousing over a collapsed region, marked as “...”, shows a WPF-based preview of the collapsed region’s contents.
- Collapsed regions can be expanded by clicking on the + glyph in the outlining margin or by double-clicking the “...” glyph in the code itself.
- We’ve added a few new outlining commands, including the oft-requested ability to Expand All Outlining or Collapse All Outlining.
Check out this video to see outlining in action (no need to turn up your sound – there’s no audio):
Whether you love the new design or think there’s still room for improvement, please use the comments or the Email link to share your opinion. You’ll also be able to play with this feature in the upcoming Visual Studio 2010 beta (still no official release date, but stay tuned – we’ll post it as soon as it’s announced). This redesign was a direct result of your feedback, so please continue to let us know what you think!
Brittany Behrens
Program Manager, VS Platform Team
-
The new editor is featured in the cover story for the April issue of Visual Studio Magazine! The magazine publishes news and information for professional developers, and this month it is spotlighting Visual Studio 2010 in an article called “IDE Evolution”. Here are a few highlights:
“In VS 2010, developers can experience firsthand the beginning of the IDE's evolution: improved code navigation, annotation and extensibility with the WPF-based shell; better performance and scalability for native code; and fundamental improvements in debugging and test-driven development.”
“What we want is flexibility and extensibility. For instance, it's because the new editor is WPF-based that we can, for reasonable engineering cost, offer the ability to add inline adornments, margins, even 'heads up display' style extensions. ... The best part is you won't have to wait for us to do these things -- you want profiler information overlaid on your text? No problem. Go do it. Test coverage? Hot links to documentation? Online presence indicators based on e-mail names in comments? You could do all these things.”
The article gives a great overview not only of the new editor but also of Visual Studio 2010 as a whole, including the new shell, extension manager, Managed Extensibility Framework (MEF), and new features for the Team System (VSTS) editions. If you’re interested in hearing the latest buzz about VS 2010, I’d encourage you to read the article, available free online here.
Brittany Behrens
Program Manager, VS Platform Team
-
The Editor team wants to build the best product possible, and we need your help! This week, the team would like to ask for direct feedback on how you use tab size and indent size. Tab size is the amount of space each tab occupies, while indent size is the amount of space automatically inserted for each level of indentation at the left of a line. Both options can be found in Visual Studio under ToolsàOptionsàText Editorà[Your Language]àTabs, and by default both are set to 4 spaces.
For example, if you turn on visible whitespace with tab size = indent size = 4, your code would look like this:

But with tab size = 4 and indent size = 8, the same code would look like this:
One of the many advantages of the new editor is that unlike previous versions, Visual Studio 2010 can support multiple font faces and multiple font heights. With this new capability, there are more choices than ever for how to format your code, which led the Editor team to some interesting design questions. We want to make sure we design features that look great and feel natural in your most important use cases. With that in mind, we'd like to know:
· What are your preferred tab & indent size settings? Why do you choose that particular configuration?
· Do you keep tabs or insert spaces?
· Is there a case where you use different tab & indent sizes? If so, please tell us the scenario.
Feel free to leave a comment or use the Email link. The more we understand about how you use Visual Studio, the more we can improve it. And stay tuned for the next post, when we’ll give you a sneak peek and a chance to tell us what you think about an updated UI for code outlining.
Brittany Behrens
Program Manager, VS Platform Team
-
To complete the VS 2010 Editor’s new look, we’re updating the default font to 10-pt Consolas! It’s a fixed-width font that Microsoft’s typography experts designed specifically for developers, so it’s great for reading and writing code. Consolas also has proportions that are closer to normal text than Courier New, the default for VS 2005 and 2008, making it more readable while still maintaining monospaced width. Here’s a side-by-side comparison:

You’ll see the new default font in the upcoming VS 2010 beta, but the Editor team is also interested in your feedback now. Although it’s new to the default role, Consolas has been around for a few years, so you can try it in your current version of Visual Studio. If you’re running Windows Vista, you already have Consolas installed; just go to ToolsàOptionsàEnvironmentàFonts and Colors in Visual Studio and change the font. If not, it’s available as a free download from Microsoft here.
To see the best results, I strongly recommend turning on ClearType in Windows XP or Vista before trying Consolas. ClearType improves font quality and readability in WPF and can be optimized for your display. For instructions on how to enable and configure it, check out Microsoft’s ClearType tuner here.
I hope you’ll enjoy Consolas’s natural readability for coding in VS. As always, please use the comments and e-mail link to send us your thoughts. Love the new font? Have ideas to improve it? Let us know!
Brittany Behrens
Program Manager, VS Platform Team
-
You may have seen a glimpse of the Visual Studio 2010 editor in the past couple of months, but you've never seen it look like this! At VSLive! in San Francisco last week, Visual Studio General Manager Jason Zander unveiled a completely new UI for Visual Studio 2010. It's built on WPF, which not only has a modern look but also gives VS users unprecedented ability to extend the editor with rich visualizations.
Take a look at this screenshot:

Like what you see? You can read Jason's blog post about the new UI here, or check out some of the press coverage here and here. You'll be able to play with the revamped Visual Studio 2010 when we release a beta version; the date hasn't been announced yet, but we'll keep you posted.
Now that the world has been introduced to more of the editor, the team will also be making more frequent posts to this blog, so be sure to check back here for weekly updates, tips & tricks, and discussions. And please make use of the comments and the Email link - we're listening, we will respond, and your feedback will help make Visual Studio 2010 even better.
Enjoy the new UI!
Brittany Behrens
Program Manager, VS Platform Team
-
Hi,
As Sean mentioned below, the new VS10 Editor was unveiled at TechEd EMEA this week. We are all excited to introduce the new VS10 Editor to the world! The VS10 Editor was designed with extensibility from the ground up, and we want to enable our customers to build cool extensions on top of our platform. You can view the Jason Zander TechEd EMEA session at http://www.microsoft.com/emea/teched2008/developer/default.aspx
Soma has a Channel9 session on the key themes for VS2010, and demos how the VS10 Editor allows for text view margin extensibility by showing off our Structure Margin sample at http://channel9.msdn.com/posts/VisualStudio/Soma-on-the-Key-Themes-for-Visual-Studio-2010/
Welcome to the new VS10 Editor!
Fiona Fung
Lead Software Design Engineer
VS Platform Team
-
Today at TechEd EMEA in Barcelona Spain, Jason Zander demonstrated a ton of new features that are part of the upcoming Visual Studio 2010 & .NET Framework 4.0 release. One of the key features that was well received by the audience was the New Editor for Visual Studio. In his demo, Jason showed how the New Editor built on top of Windows Presentation Framework (WPF) and the Managed Extensibility Framework (MEF) enables developers to extend the editor by showing several fun editor extensions.
The first editor extension shown was actually provided by one of our VSIP Partners, DevExpress. They've been working with the Visual Studio 2010 CTP over the last few weeks to provide a custom comment & image viewer inside of the Editor which demo was used to display a sequence diagram inside the code file.
The next sample extension was the "Method History Pop-up". It made use of Adornments to color code each line depending on the last developer who had touched the line and used WPF to provide a graphical animated representation of the code churn over time.
One common request that I get is for the ability to view the history of a file. With the "Micro-V" extension, Jason showed a slider at the top of the editor which switched on a historical mode that allowed him to go back and view the editing history of the file with an inline diff.
The document map margin provides an zoomed out view of the code editor which allows users to quickly navigate to important landmarks in their code. This extension to the editor demonstrated extensible margins which allow developers to add views to the side or above & below the editor.
Jason also invoked up an XML Comment Adornment which replaced existing XML comments with a much easier to read view over the comments. This was yet another example of how adornments to the code can change the way developers read & modify their code.
If you're curious about the New Editor in Visual Studio or you want to try to write your own extensions, I'd recommend downloading the "Visual Studio 2010 CTP here: http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814
Sean Laberee
Lead Program Manager
VS Platform Team
-
I know that quite a few people are running into an issue where any edition Visual Studio 2008 can crash when users open the find dialog if they are running on Windows XP 64-bit or Windows 2003 Server. There's a patch available for Microsoft Support. You can track the status of that fix here: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=311712
I've heard from quite a few people that aren't happy about contact support and I wanted to explain the rationale behind it. When we ship products at Microsoft we literally spend thousands of hours of human and computer time running manual and automated tests on the final versions of our product to ensure their quality. When we create patches for a particular issue, we can't expose the patch to the same rigorous testing so there is a chance that this will cause a regression somewhere else. To minimize that risk, we have customers call support to ensure that they are indeed experiencing the exact issue and give them the patch free of charge. If there's ever an issue with the patch, support is able to contact all affected customers. Typically, these patches are integrated into the next service pack or version of the product at which point they are exposed to the more rigorous testing.
I've also heard from a few others that there have been challenges getting the patch from support. If have a few tips for getting this patch from support to help make things smoother:
- This is a good link to start from to get support: http://support.microsoft.com/oas/default.aspx?&c1=501&gprid=12913
- My standard tip for dealing with anyone in a customer support roll is to first get the name and some sort of reference number of the incident. This will always enable you to have some continuity if you ever get disconnected or need to call back.
- The patch is only labelled for Windows 2003 but it actually works for Windows XP (64 bit of course). I'm working with CSS to get that fixed.
- If the support rep tells you that it is no longer available, please get the SRX Number and the name of the CSS rep and contact me via the blog link so that I can track down the problem.
Thanks!
Sean Laberee
Program Manager - VS Platform
-
I've got good news! Consolas, a cleartype font designed specifically for to make code more readable is now available for download for users of Visual Studio 2005 from the Microsoft Download Center.
One important thing about Consolas is that it will only look good if you have ClearType enabled. You can check the setting from the Display applet in Control Panel. On the Appearance Tab click the Effects button. Ensure the the check box "Use the following method to smooth edges of screen fonts" is checked and that it is set to Clear Type.
Thanks,
Sean Laberee