Sam's Blog

Archive for the 'Tutorials' Category

25 Jan

Creating a WPF Tool Window for Visual Studio 2010

I’ve been working on Visual Studio 2010 extensibility for some time now, and I must say that creating a tool window was not the easiest task in the world.

First Attempt: Create an MEF-friendly IToolWindowService

The original goal of this project was creating an MEF service that allowed exporting classes implementing IToolWindowProvider, and have the [...]

25 Nov

MEF support for the Output Window in Visual Studio 2010

As some people have noticed, the Visual Studio 2010 SDK doesn’t have great support for the Output Window from MEF extensions. This post aims to change that. Like several other components I’m writing about, I hope to provide this one in a “general extensibility helper” that could be installed separately from extensions that use it [...]

25 Nov

A general brace matching tagger for Visual Studio 2010

I haven’t perfected it yet, but here is a fairly general brace matching tagger that seems to work very well. It relies on the classifier for the content type properly tagging comments and literals with classification types derived from PredefinedClassificationTypeNames.Comment and PredefinedClassificationTypeNames.Literal, which any decent classifier will do.

This example really shows a big improvement in [...]

25 Nov

Tool tips for squiggles and URLs in Visual Studio 2010

I’ve been experimenting with Visual Studio’s new extensibility model, and ran into a problem with squiggles. It seems that despite having an internal IQuickInfoSource for the SquiggleTag and IUrlTag, it’s not hooked up to a IIntellisenseController so it never appears. Here is a general implementation for an SquiggleQuickInfoIntellisenseController and UrlQuickInfoIntellisenseController that will provide QuickInfo for [...]

25 Mar

Visual Studio language services: Improved brace matching hooks

By default, brace matching is performed in response to the left and right arrow keys. It should be done in response to several additional commands, as shown below.

19 Oct

ManagedMyC: Type and member dropdown bars

This is part 4 of [many?] posts about creating an ANTLR-based language service for Visual Studio.

Now that we have an AST with information about the top-level members in our source files, we can use the tree parser to gather this information and make it available for the dropdown bars. For now, the MyC language doesn’t [...]

18 Oct

ManagedMyC: Intro to building an AST

This is part 3 of [many?] posts about creating an ANTLR-based language service for Visual Studio.

Sure a scanner and parser are cool, and syntax highlighting is nice. But the real power in the Visual Studio language services comes in their IntelliSense abilities, and supporting those effectively requires building and processing an AST. In this section, [...]

17 Oct

ManagedMyC: Code folding for functions

This is part 2 of [many?] posts about creating an ANTLR-based language service for Visual Studio.

Since this is a near-trivial feature to add based on the code in my previous post, I’ll go ahead and get it in tonight. We want to fold from the opening { to the closing } of a function, so [...]

16 Oct

Custom Visual Studio language services: ManagedMyC meets ANTLR

As some of you know (ok probably not many of you), I’m the author behind Pixel Mine nFringe, a custom language service framework that we used to provide UnrealScript editing & debugging features in Visual Studio 2005 and 2008. To date, I’ve written 2 full language services with it (UnrealScript and Antlr v3) and toyed [...]

07 Oct

Custom Visual Studio language services: Tracking recently used items in autocompletion lists

The C# language service has the great feature of remembering recently used items in the completion lists (auto-complete, complete word, member select, etc.). You can add a similar ability to your language service by deriving your Declarations-derived class from MruDeclarations instead of Declarations.

© 2010 Sam's Blog | Entries (RSS) and Comments (RSS)

Your Index Web Directorywordpress logo