Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / IDE

Use Camel-Case and 'Contains' Filtering in Visual Studio 2010's IntelliSense

3.00/5 (3 votes)
9 Aug 2010CPOL 1  
Handy Keyboard Shortcuts in VS2010's IntelliSense
So we all know that if you start typin Object.Property you're going to get an IntelliSense list that is filtered by the first few characters...by the time you type .Pro, you've likely found what you're looking for.

In VS2010 we get a couple of other handy features: Pascal-case filtering and 'contains' filtering.

Pascal-Case Filtering
Members of objects in .NET are typically named with WhatWeLikeToCallThePascalCase convention, where the first letter of every word in a phrase is capitalized.

To activate this type of filtering, say, for an object that is a DataContext, you could type the following:

dc.EQ


This would filter the list down to "ExecuteQuery". Nice!

"Contains Filtering"
In previous versions of Visual Studio IntelliSense was extremely useful if you remembered what the member you were going after started with. Basically, the first few keystrokes filtered the members by the characters they started with.

In VS2010, you can now find all members that match your keystrokes anywhere in the member name. For example, on a DataContext, typing:
dc.dat


...would give you a list of the following members:
DataContext.CreateDatabase
DataContext.DatabaseExists
DataContext.DeleteDatabase


You can see how it doesn't matter that "dat" wasn't capitalized and how dat comes from wherever in the members.

Cheers!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)