Extend IntelliSense for XAML Visual Studio 2010 Editor

Original author: Karl Shifflet
  • Transfer
image
Having appreciated the new IntelliSense features in the VS 2010 code editor, using the PascalCase principle, when you get a list of suggested commands as you type. Unfortunately, new tasty features are not available in the XAML editor. But there is no reason for sadness ...
image

image

Opportunities
  • PascalCase Support
  • Optional filters
  • Item Type Filtering
  • xmlns IntelliSense options
    • Show / hide project assemblies only
    • Show / hide schemes

  • Settings filtering is saved for the current Visual Studio session.

PascalCase Overview


The PascalCase-filtering principle allows you to quickly find the required elements, the search is in capital letters and begins to search if there are at least two capital letters.

The image below shows how this filtering method works.

PascalLookupOne

Installing an assembly using xmlns PascalCase is done in three counts.

PascalLookupTwo

Automatically narrowing list filter


When the narrowing filter is active, it adds two additional features:
  • A narrowing list of displayed items that contain your text.
  • Priority selection of list items
    • Highlights the first element that begins with your text.
    • Selects the first occurrence that contains your text.


http://img684.imageshack.us/img684/1791/narrowlist.png

See how easy it is to find Grid.Row or Grid.RowSpan when narrowing the list.

NarrowingEnabledTwo

Filter list items by type


Actually this item was the main driving force in writing the extension. I was a little confused, when I entered XAML, I got a list consisting of 2 properties, 4 events and 75 namespaces. The problem is resolved.

A standard list of elements, notice how many namespaces there are.

Namespaces

Press the button on the panel and the namespace will disappear from the list:

NoNamespaces

Other buttons work in the same way. A gray background indicates an active state. White background is an inactive state.

xamlns IntelliSense


The image below shows two filter buttons that xamls IntelliSense provides.
  • Only displays project assemblies if active
  • Removes occurrences of the circuit if active

xmlnsOne

Another way to get your builds in a quick way is demonstrated below. Two filter buttons in the standard state and I enter WC to quickly find the assembly in my project.

xmlnsTwo

Below, I use the auto-narrowing list functionality to search for all assemblies that contain the word 'media'. The search also includes values ​​in parentheses.

xmlnsThree

Extension manager


To view the installed extensions, use the Visual Studio 2010 menu: Tools-> Extension Manager:

ExtensionManager

From here you can turn off or remove any extension.

ExtensionManagerTwo

You can also change the settings for extensions through Tools-> Options.

ToolsOptions

Requirements


Visual Studio 2010 Release Candidate or later.

It will probably work on Visual Studio 2010 Beta2, but I have not tested it.

Downloads


XAML Editor IntelliSense Presenter Extension VSIX Installer (41KB)
XAML Editor IntelliSense Presenter Extension Source Code (optional) (39KB)   (C # source code)

For source code


If you still decide to download the source code and possibly modify it. You must definitely uninstall the extension if you used VSIX to install it.

In addition, if you want to create your own extension, make sure that the next folder is empty before starting a new project. If you have conflicts in the project, or there is another IntelliSense extension in this folder, then you may have conflicts during debugging.

C: \ Users \ <username> \ AppData \ Local \ Microsoft \ VisualStudio \ 10.0Exp \ Extensions

How does it work?


I learned a lot by creating this extension. In the following weeks, I will explain how the code for this extension works and how it differs from the CodePlex example .

And the last


After starting Visual Studio 2010, I will make the proposed changes and publish the new version on the blog and in the Code Gallery.

I hope you enjoyed the XAML editor extension.

Also popular now: