Incremental Intellisense Improvements in Visual Studio 2010

Introduction

Some improvements like LINQ are substantial, and some just make our lives a little easier. Intellisense in Visual Studio 2010 has an improvement that is incremental and will make the life of a programmer a little easier.

In VS2008 Intellisense listed members alphabetically by matching characters as you type them. In VS2010 Intellisense lists members using a contains-a approach. Let's take a few minutes to explore this incremental improvement to the VS2010 IDE.

Evolution Lived

In a very early version of C++ I realized one could modify the basic IO functions like printf add a second version of the methods that wrote directly to a second video buffer. The primary implementation of these methods wrote to the primary video and comprised the programs output. By adding a second monitor-a CGA monitor-and adding the equivalent of trace statement and sending them to the CGA video memory you can have your primary output, which in those days was a text-based GUI-display, on your primary monitor and trace statements appear on the CGA monitor. Viola! Two monitors in the days before it was en vogue.

Video buffer memory is still accessible. To see this open a cmd window, run the debug.exe program and send some data right to video memory. (For the demo I am using EGA video memory because I can't recall the CGA video memory addresses.) It is worth noting that odd numbered memory addresses at EGA memory represent the background and foreground RGB colors, and that my typographic errors (shown in Figure 1) show you just how error prone this approach can be (which in turn demonstrates why good debugging tools were and still are so necessary).

RGB Grid
Click here for larger image

raw data right into EGA video memory
Click here for larger image

Figure 1: Entering the raw data right into EGA video memory will display ASCII characters and RGB colors directly to video memory.

Thankfully debugging evolved shortly thereafter with Borland's Turbo Pascal Integrated Development Environment (IDE) and continue to evolve today. Now we have built-in Output windows and Intellisense that make debugging what's going on and figuring out what code base we have to work with substantially easier. (To demonstrate Intellisense for VS2010 I will demonstrate how to redirect IO using .NET in the section "The New and Improved Intellisense".)

Intellisense in Visual Studio 2008

Intellisense in Visual Studio works by displaying members alphabetically. When you type an object name followed by the member of an operator (.) and some alpha-numeric characters Visual Studio will display a drop down window, the first member that start with those characters and then the members that follow alphabetically. Visual Studio 2010 improves on this approach.

The New and Improved Intellisense

When you type an object name, followed by the member of operator in Visual Studio 2010, Visual Studio will display all of the members that start with or contain those characters. Instead of a starts-with, alphabetic listing, Visual Studio 2010 displays a list of members that contain those characters anywhere in the member name, as long as those characters are in the same relative order and the case matches.

To demonstrate, the code in Listing 1 shows you how to redirect console IO to a WinForm of your choosing, instead of the IDE's Output window. I will use this code to show you how Intellisense lists members in VS2010. (Listing 2 shows you how to add a TextBox to a form and initialize the MyStreamWriter class with the TextBox, resulting in Console Write and WriteLine method calls buffering data in the Form's TextBox.)

Listing 1: Building your own debug window in VS2010 using console IO redirection.

  Imports System.Windows.Forms
  Imports System.Text
  
  Public Class MyStreamWriter
    Inherits System.IO.TextWriter
  
    Private control As TextBoxBase
    Private Builder As StringBuilder
  
    Public Sub New(ByVal control As TextBox)
      Me.control = control
      AddHandler control.HandleCreated, _
         New EventHandler(AddressOf OnHandleCreated)
    End Sub
  
    Public Overrides Sub Write(ByVal ch As Char)
      Write(ch.ToString())
    End Sub
  
    Public Overrides Sub Write(ByVal s As String)
      If (control.IsHandleCreated) Then
        AppendText(s)
      Else
        BufferText(s)
      End If
    End Sub
  
    Public Overrides Sub WriteLine(ByVal s As String)
      Write(s + Environment.NewLine)
    End Sub
  
    Private Sub BufferText(ByVal s As String)
      If (Builder Is Nothing) Then
        Builder = New StringBuilder()
      End If
      Builder.Append(s)
    End Sub
  
    Private Sub AppendText(ByVal s As String)
      If (Builder Is Nothing = False) Then
        control.AppendText(Builder.ToString())
        Builder = Nothing
      End If
  
      control.AppendText(s)
    End Sub
  
    Private Sub OnHandleCreated(ByVal sender As Object, _
       ByVal e As EventArgs)
      If (Builder Is Nothing = False) Then
        control.AppendText(Builder.ToString())
        Builder = Nothing
      End If
    End Sub
  
    Public Overrides ReadOnly Property Encoding() As System.Text.Encoding
      Get
        Return Encoding.Default
      End Get
    End Property
  End Class

Listing 2: Initialize MyStreamWriter with a TextBox residing on a form to send Console IO to the TextBox instead of a command window or the Output window in Visual Studio/

  Public Class Form2
    Private writer As MyStreamWriter = Nothing
  
    Private Sub Form1_Load(ByVal sender As System.Object, _
       ByVal e As System.EventArgs) Handles MyBase.Load
      writer = New MyStreamWriter(TextBox1)
      Console.SetOut(writer)
    End Sub
  
  End Class

Look at the Inherits System.IO.TextWriter statement in Listing 1. If you type System.IO. then Intellisense in Visual Studio 2010 will start with an alphabetic listing of members. When you start typing the listing is refined. If you type capital T, as in System.IO.T, instead of an alphabetic listing with members starting with T Intellisense will list all members starting with or containing a capital T. In Visual Studio 2010 a capital T will result in PathTooLongException,TextReader, and TextWriter. The logic here being what's the point of listing members that have no T just because they precede or follow members with T alphabetically.

Continuing the above scenario if you type System.IO.TW then the TextWriter method will be displayed because TextWriter is the only member with a capital T and W in that order (even though there are letters in between).

Summary

Intellisense has been incrementally improved in Visual Studio 2010. Instead of a associative alphabetic listing only members that contain the actual letters you type are displayed. If a member doesn't contain one of your letters then the member is filtered out.

The historical perspective on dual monitor debugging and tracing was added because in part this is the kind of thing that floats in my head. However, it may be interesting to newer developers to learn something about the ongoing existence of older solutions and contrast those to how much things have improved. Programmers used to have to memorize everything before Intellisense, and debugging was a painstaking process of manually examining code and write line statements. Integrated debuggers and trace windows are a relatively new invention, spanning a period of less than one person's career in computer science.

The sample code was added just so you'd have some code to chew on to play with Intellisense. The console redirect technique is a nice tool to keep around and it is fun to play with, but you can use any code to explore the changes to Intellisense. (The console code was originally published as "Redirect I/O to a TextBoxWriter in .NET" in April, 2006.)

About the Author

Paul Kimmel is the VB Today columnist for CodeGuru and has written several books on object-oriented programming and .NET. Check out his upcoming book Professional DevExpress ASP.NET Controls (from Wiley) now available on Amazon.com and fine bookstores everywhere. Look for his upcoming book Teach Yourself the ADO.NET Entity Framework in 24 Hours (from Sams). You may contact him for technology questions at pkimmel@softconcepts .com. Paul Kimmel is a Technical Evangelist for Developer Express, Inc, and you can ask him about Developer Express at paulk@devexpress.com and read his DX blog at http:// community.devexpress.com/blogs/paulk.



Comments

  • 2013 redresseurs ghd en vente, acheter lisseur ghd pour vous à Oslo

    Posted by pletcherwtm on 07/15/2013 11:33pm

    Défrisants GHD ne sont pas seulement lisser vos cheveux et lui donner l'air élégant et brillant. En utilisant correctement, curl, flip ou agiter vos cheveux. Le même produit que vous utilisez pour le lissage peut également être utilisé pour d'autres styles innovants, c'est à cause de ses plaques et poignées arrondies, conçus spécifiquement pour soutenir votre publics wrist.The bientôt accepté la marque, et dans un court laps de temps, a atteint le succès . Maintenant de nombreuses célébrités et des stylistes professionnels admirer les produits de GHD. [url=http://ghdpascherferfr.blinkweb.com/]ghd pas cher[/url] Troisièmement, ils ont également arrondis barils qui peuvent faire un fer GHD plus polyvalent que beaucoup d'autres types d'appareils de coiffure sur le marché. Si vous souhaitez modifier votre chevelure est souvent avantageux d'utiliser défrisants ghd peut aussi créer des vagues, sauts et loops.Endelig, vous devez sélectionner un fer GHD est conçu pour une utilisation dans une explosion ou frange. GHD IV styler Mini est parfait pour beaucoup moins de cheveux. Combinez ces excellentes caractéristiques redresseurs les plus complets, mais il est plus facile à utiliser sur des petits morceaux de hair.Maybe vous savez ce ghd lisseur [url=http://ghdpascherfer.tripod.com/]ghd lisseur prix[/url] Lisseur GHD est un outil de style professionnel avec revêtement avancé de perles en céramique pour une distribution uniforme de la chaleur et de douceur glissent à revêtement céramique normal. Il ne sera pas coincé dans les cheveux et le rendre brillant et droite à zéro tid.Høytpresterende redresseur avec cordon de revêtement en céramique et chauffage rapide à 10 sekunder.Den fonctionnalités réglage automatique de la tension pour le bon fonctionnement dans le monde, il s'éteint automatiquement après 60 minutes et il a un fil à charnière de 3 mètres. Une pochette de rangement résistant luxueux et chauffage inclus.

    Reply
  • Wat is er zo goed over hoofdtelefoon

    Posted by mrswanzi on 06/05/2013 06:16pm

    [url=http://koptelefoon-monsterbeats.blogspot.com/]monster beats koptelefoon[/url] Wanneer je Beats By Dre kopen gaat, zorg er dan voor dat je deze bij een officile dealer besteld. Verder wil je natuurlijk de beste prijs en een goede garantieservice. Wij raden je aan om bij een van de onderstaande webshops te bestellen. Bij deze shops weet je zeker dat je vertrouwd je Beats kunt kopen met een goede prijs, snelle verzending en goede garantie.Zorg er dan voor dat u goed geinformeerd bent. Van het merk Beats By Dre is er veel namaak op de markt, zorg er dus goed voor dat u geen sukkel bent die met een goedkope immitatie komt te zitten omdat u een paar tientjes wilt besparen. U wilt een hoofdtelefoon of oortjes van beats by dre kopen [url=http://monsterkoptelefoon.npage.de/]beats by dre kopen[/url] Om de fraaie hoofdtelefoon in topconditie te houden krijgt de gebruiker er ook een zacht poetsdoekje en een stevige beschermcase bij. En tenslotte wordt er ook een set AAA-batterijen meegeleverd voor direct luisterplezier. De Studio-hoofdtelefoons maken gebruik van noise canceling, waardoor omgevingsrumoer onderdrukt wordt. Alle modellen worden zeer compleet geleverd met twee kabels. Hiervan is er een voorzien van een gentegreerde microfoon en bedieningstoetsen voor gebruik met iOS-apparaten. [url=http://koptelefoon.qsite.dk/]Monster koptelefoon[/url] Nog voor de headphones voor de consument op de markt verschenen, liepen verschillende grote artiesten uit de Amerikaanse hip hop- en rapscene al met een Beats by Dr. Dre rond. Zo is Lady GaGa in de clip van Pokerface uit 2008 te zien met een Beats by Dr. Dre. Het is slechts een paar tellen, maar na de introductie van de muziekvideo stellen vele fans diezelfde twee vragen: van welk merk is toch die hoofdtelefoon met die rode B en hoe kom ik daaraan Steeds meer artiesten volgden het voorbeeld van LeBron James en Lady GaGa. Niet omdat de hoofdtelefoons significant beter waren dan andere merken, maar puur vanwege de uitstraling: mode.

    Reply
  • GHD Ren Hvid Styler

    Posted by cheneason on 05/30/2013 02:50am

    [url=http://www.comprarbeatsbaratos.weebly.com/]Comprar beats baratos[/url] Alle GHD IV Pink Styler er af høj kvalitet og prisen er meget reasonable.There er forskellige stilarter for dig at select.Key funktioner i GHD Hårudglatningsmiddel omfatter: mere lydhør, dybt affjedret keramiske plader, at varme op endnu hurtigere. Hørbar bip, der fortæller dig, jernet er varmt og klar til brug. Længere og mere holdbar Kablet har et forbedret design for at mindske potentielle skader, som du stil med jern. Auto-justering af spænding betyder, at du kan bruge dit jern i noget land. Sikkerhed funktioner, herunder automatisk slukker efter 15 minutter uden aktivitet, og en gysen funktion, der forhindrer fugt beskadige din strygejern, når de er blevet efterladt i et koldt sted natten over. [url=http://www.beatsbydre2013.moonfruit.com/]beats by dre españa[/url] En fremragende “øjeblikkelig conditioner” er almindeligvis en bestemt dette specifikke præcise klæder din gode hår dage krøllet hår glatning klubber samt giver disse fysik foruden glimt. Speedy hår hårbalsam minimere den faktiske unikke forbedrede neglebånd, oprette dine distinkte god Ghd Tilbud Tresses gør dig hår jern moderat desuden opnås, med hinanden ved hjælp af assistance sikre den faktiske tydelig indre design i de ekstraordinære vilde hår tidsperioder basis via skade gennem betyder at involvere medvirken såsom en filtrering. Denne form for afhjælpning vilde hår emne vil rutinemæssigt blive gengivet anytime ens personlige Ghd hår styling jern vil blive skyllet ud. [url=http://www.beats-by-dr-dre5.webnode.es/]Beats by dr dre[/url] Masser af enkeltpersoner butik på internettet inden for ord, der involverer lethed og komfort som et alternativ til køber bistand. Kunde plan online giver forbedret alligevel den faktiske individuelle del af off-line indtjening fortsætter med at være mangel på. En række art vedrørende organisation bliver salon eller blot en fase spa bygger op med bestemt person lidenskabelig forbindelse. Hver eneste solo valg forbundet med disse former er forbundet med dejlige stylers kan godt forekomme at arbejde med smukke person, temps beskyttelse quiltet håndtaske som lysarmaturer farve sammen sammen med dinGhd Fladjern er du nødt til at få ram på den samme tid til at få set næsten enhver dårlig situation, som i turn repræsenterer du eventuelt kunne gemme disse mennesker specielt præcis, hvor du vælger at bevæge sig fremad. Mens absolut alle fuldt ud at forstå god hår dage er virkelig identificeret sammenlignes for at hjælpe en fantastisk virksomhed, der vil ofte leverer din ideelle køber bistand, som vil betyder du vil være i stand til regelmæssigt at generere komme i kontakt med med den slags forbundet med. rød-farvet Lust Gode hår dage vil uden tvivl øge taget i betragtning tilsluttet låse system.

    Reply
  • Interesting. Could have been still better.

    Posted by Alok Govil on 12/18/2009 03:40pm

    This is a nice idea and could have been made even more interesting. Intellisense basically helps the user not just as a typing aid, but it also helps look up the needed object/member faster rather than going back-and-forth between code editor and documentation. When searching alphabetically, developer keys in something and then sometimes need to scroll over the list to find what is needed. When looking for Height, SetHeight won't immediately show up. With the new approach, typing Height will reveal both Height and SetHeight in this example. Why then make it case-sensitive? Developer looking for Height should also see height or set_height. Not everyone may be following same naming conventions as Microsoft. Why not make this a true quick "search", that may even search not just in object/member names but also their descriptions (coming from XML descriptions or MSDN help). So even Size would show up when looking for Height, ableit would show up lower in the list if Height itself is available. Just so many times you need Length right after finding Height. The "search" may also reveal related items that the developer could be looking for.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • CentreCorp is a fully integrated and diversified property management and real estate service company, specializing in the "shopping center" segment, and is one of the premier retail service providers in North America. Company executives travel a great deal, carrying a number of traveling laptops with critical current business data, and no easy way to back up to the network outside the office. Read this case study to learn how CentreCorp implemented a suite of business continuity services that included …

Most Popular Programming Stories

More for Developers

RSS Feeds