📜 ⬆️ ⬇️

Extending IntelliSense for XAML Editor Visual Studio 2010

image
Assessing the new features of IntelliSense in the VS 2010 code editor, on the principle of PascalCase, when in the course of printing you receive a list of suggested commands. Unfortunately, the new tasty features are not available in the XAML editor. But there is no reason for sadness ...
image

image

Opportunities

PascalCase Review


The principle of PascalCase-filtering allows you to quickly find the required elements, the search goes in capital letters and begins to search when 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 accounts.

PascalLookupTwo

Auto taper list filter


When the list narrowing filter is active, it adds two additional features:
  • Narrowing list of displayed items that contain your text
  • The priority of selection of elements of the list
    • Select the first element that starts with your text.
    • Select the first entry that contains your text.


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

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

NarrowingEnabledTwo

Filtering list items by type


Actually this item was the main driving force when writing the extension. I was a little confused when I entered XAML I received a list of 2 properties, 4 events and 75 namespaces. Problem solved.

A standard list of elements, notice how huge the number of namespaces is.

Namespaces

Release the button from the panel and the namespace will disappear from the list:

NoNamespaces

Other buttons work on the same principle. Gray background indicates the active state. White background - inactive state.

xamlns IntelliSense


The image below shows the two filter buttons that xamls IntelliSense provides.
  • Displays project builds only if active.
  • Removes schema occurrences if active

xmlnsOne

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

xmlnsTwo

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

xmlnsThree

Extension Manager


To view the installed extensions, use the menu of Visual Studio 2010: 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 older.

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

Downloads


XAML Editor IntelliSense Presentation Extension VSIX Installer (41KB)
XAML Editor IntelliSense Presentation 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 necessarily 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 any conflicts in the project, or there is another IntelliSense extension in this folder, then you may experience conflicts when 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 last


After launching Visual Studio 2010, I will make the proposed changes and post a new version in the blog and in the Code Gallery.

Hope you enjoyed the XAML editor extension.

Source: https://habr.com/ru/post/88661/


All Articles