📜 ⬆️ ⬇️

VS 2010 Intellisense Improvements

image In today's post, I will talk about a small, but very convenient innovation in intellisense in VS 2010, which improves the type and member autocompletion filter. You can more easily and efficiently work with the API when writing code.



Intellisense work in VS 2008
')
In order to properly evaluate the intellisense innovation in VS 2010, let's run a simple script in VS 2008, where we want to write simple code that changes the properties of the GridView.

We start typing “GridView1.Edit” to see the list of available Edit control members. In VS 2008, intellisense shows a filtered list with items that start with the word “Edit”

image

A great option if we need a method / property / event that starts with “Edit”. But this does not work well if the element of the object we are looking for begins with other words (for example, the “RowEditing” event or the “SetEditRow ()” method). We have to scroll the list up, down, searching for the desired item, or even opening the Object Browser or MSDN.

Intellisense work in VS 2010

Now let's try to do the same scenario in VS 2010. When we type “GridView1.Edit” in VS 2010, we see that the EditIndex property is highlighted by default. But, the intellisense list filtered and showed all the elements that contain the word “Edit”.

image

This innovation allows you to quickly find the desired method / property / event responsible for changing the object.

Search for keywords

This new filtering feature in VS 2010 is very useful for finding any member, no matter what word it starts with. For example, if we want to activate page navigation in a datagrid, but we cannot remember how to do this. Just write “GridView1.Paging” and in the list that appears, all elements that contain the word “Paging” will be filtered. Note that the GridView does not actually contain any objects that begin with the word “Paging”.

image

Type search

New filtering feature in VS 2010, which allows you to quickly find the necessary classes and types. For example, when we type “List” to declare a variable, the editor will automatically filter and show all types that contain the word “List” in the title (including IList <> and SortedList <> that do not begin with “List”).

image

Intellisense based on Pascal Case

The .NET Framework naming rules specify that type and member names are based on “Pascal Cased” by default. This means that every word in a type or member must begin with a capital letter (for example: P age I ndex C hanged).

Intellisense filtering in VS 2010 allows you to quickly search and filter objects named according to Pascal naming rules. For example, if we print “GridView1.PIC”, then VS 2010 will filter and show all members that contain a PIC in their name, as well as members that are named for “Pascal Cased”, whose word segments begin sequentially with the given letters:

image

Note that the PIC displays both “PageIndexChanged” and “PageIndexChanging”. This saves us from unnecessary keystrokes to write any object name.

Update
Continuing the theme of innovation - Search and navigate the code in VS 2010

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


All Articles