Code Focused Development in VS 2010

Code Focused Development in VS 2010

  • Comments 43

In a blog post in November, I mentioned a feature called “Quick Search” - one of the code focused features of Visual Studio 2010.  We have been lagging behind some in this area in the past and we wanted to focus on this as a key pillar for Visual Studio 2010.  Today, I’d like to share some more details of our code focused development investments and features.   

Highlight References

Highlight References is a simple but easy way to quickly understand a scoped piece of code and navigate to references.  The feature is activated automatically after a short delay - all references to the symbol under the cursor are highlighted.  Navigating to the next reference is easily done by pressing Ctrl + Shift + UpArrow (or DownArrow for the reverse direction.)  In the example below, you can see this feature in action; you may also notice that it infers which overloads bind to the current selection rather than a pure text match.

Quick Search

Quick Search was the code focused feature I mentioned previously.  It works for all C++, C#, and VB symbols and all file types.  It’s a very lightweight way to do incremental searches, quickly filter the results and get powerful search heuristics like substring.  Let's take a look at how I might use Quick Search.

If I was looking for an event handler and couldn't quite remember its name but knew that I used the typical naming convention, Quick Search can help.  My first step is to find all method signatures that contain the word "Click" by typing “Click” into Quick Search.

At that point, I may remember that it also contains "Enter"; by added the letter “E”, I’m able to quickly filter to everything that contains both "Click" and "E", treating the space as a wildcard search.  I’ve now reduced the results to a short list I can choose from.

Quick Search even supports camel-case matches.  So, for example, if I type in capital, "SPF", Quick Search will filter the results to only those that are a camel-case or exact match!

Call Hierarchy

Another scenario we're focusing on is reviewing dependencies.  For example, if I make a change to a method, I might want to know all the instances where it’s being called.  In VS 2010, we're improving the call browser experience in C++ and also bringing a new call hierarchy tool to C# and VB.  These features let you easily navigate all callers and callees of a method (see below.)

The call hierarchy tools also allow you to see all overrides of a method and any implementers of interface methods.  For instance, if I want to see who implements the MakeSound() interface method, I can invoke call hierarchy to see that there are two implementers, in Cat and in Dog.

Consume-First Development

Many features in Visual Studio, such as IntelliSense and Quick Info work best when an API that a user is consuming is already defined.  We recognize, though, there are times you need to code against an API that has yet to be defined completely.  For example, in test-driven development (TDD) we see the test-first pattern.  So, in VS 2010, we’re making it easier to do consume-first development.

I had previously talked about the "generate from usage" feature which generates code stubs for types, methods, properties, and constructors inferred from a symbol’s usage in code.  In the screenshot below, you can see “generate from usage” at work.

Generating the constructor will generate the following code:

However, we're also investing in a "consume-first" mode for IntelliSense that allows you to easily toggle the commit behavior for IntelliSense.  In Visual Studio today, you may have had the experience of having the IDE auto-complete an identifier you didn't want because it didn't yet exist (think generic method return types.)  In the case below, if you typed "Puzzle", IntelliSense preselects "PuzzleTest".  Hitting “space” or Enter will insert "PuzzleTest".

Instead, you’ll be able to hit Ctrl+Alt+Space to toggle on the "Consume-first" mode.  Now, when you type "Puzzle", "PuzzleTest" is still included in the list but is won't be actively selected; what you’ve just typed will be what’s inserted. 

These are some examples of the kinds of things we are doing in Visual Studio 2010 to make your jobs easier and more productive. 

Namaste!

Leave a Comment
  • Please add 4 and 8 and type the answer here:
  • Post
  • Great blog post Soma!!!

    I think it would be great if you could share some thoughts on when another CTP / beta might be available.

    hint hint hint :)

    Namaste!

    - Doug

  • These improvements seem nice, though some free IDEs have had features like this for a while now :)

  • Hi Doug,

    In the next few months we are focused on doing a lot of the feature work and will have a better idea then about when we could share a build with you all.

    -somasegar

  • THIS is the kind of features I'm looking forward to and NOT a WPF shell. So please don't ruin everything by making the IDE slower then it already is.

    Just yesterday I had VS6 and VS2008 open, compiling a large C++ project in VS6 and VS2008 was minimized doing nothing. Went away and when I came back VS6 was done and VS2008 crashed. VS2005 also crashes everytime I close it (.NET BroadcastEventWindow...).

    If I would be the CEO of Microsoft I would fire a dozen of people in DevDiv, what you guys turned VS into is just pathetic.

  • Any thoughts on auto-documentation?

    Reverse engineer all the UML diagrams for me, and allow me to select a variable level of drill-down for my documentation?

    The old staple of the '70s, a rules-based pretty-printer...

    Seems to me that VS is in the 'mature product' part of the product lifecycle curve now, so some of these add-ons might get a look-in?  

    Do they feature in the wish list anywhere near the top? And are they moving up or moving down?

    Many thanks.

  • I am looking forward to trying out the new features when VS 2010 comes out. I like the searching and IntelliSense improvements. Great article!

  • I think VS2008 is the best release of VS so far, really nice performance, and I look forward to VS2010.  The more you can use of WPF the better, Expression Studio 2 is a great example of what you can achieve from WPF.  Performance wise, startup time is a bit slower than VS2008, but acceptable, and well worth the better UI as a result.

    Keep up the good work!

  • Mr Somasegar -

    While we are great admirers of the upcoming MSDN tools (e.g., VS2010) and we are all eagerly looking forward to it, MS seriously needs to fix current problems in CodePlex for the all developers. For example, download of SQL Server 2008 Sample databases and even other MS developer  items like IronPython 2.0 samples. The chronic problems of the CodePlex download mechanism is UNACCEPTABLE. To have a great product like SQL Server 2008 be stymied by incompetent engineers who can't fix the download of the sample databases is unforgivable.

    Please look into it.

    With thanks,

    Supriyo "SB" Chatterjee

  • It is really nice to see these features in visual studio. I work on Java and try VS (mostly C#) for fun.. Most of the features you have explained are available in Eclipse (an IDE for Java) way long back.. I always miss those features when working in VS..

  • Thanks for the insight on new features.

    VS is a great product, but it is always surprising to see that it is lacking a lot of helpful features that competing IDEs have. How about getting to subclasses of a class quickly ? To implementers of an interface ? Even getting to usages of an item involves what looks like a full-text search.

    I use Resharper to complement VS and this is almost a required buy to be productive.

    For a simple developer like me, MS reasoning of only providing bare-bones features is hard to understand.

    Do you do it to give ISVs some breathing room ?

    Best regards,

    Jean-Marie

  • I imagine for the ReSharper developers to accomplish what they have took 5 times the work and brilliant problem solving than it should have because of the ugly, incomplete, COM based, buggy, 15 year old Visual Studio extensibility model.

    Perhaps Microsoft should simply buy ReSharper and their devs from Jet Brains and turn them loose to build the C# VS package.

    If that isn't doable, the 2nd best thing you could do would be to put a switch into VS that enables us to JUST TURN OFF ALL OF THE VS FEATURES for specific file types so my computer quits wasting cycles on them because my third party add-in (e.g. ReSharper) is doing a better job, thank you.

  • .NET 7 Good Rules to Log Exceptions State Machines With Enumerations Periodic Execution in .NET String

  • .NET7GoodRulestoLogExceptionsStateMachinesWithEnumerationsPeriodicExecution...

  • Hi Soma,

    MS VS team is doing good work on developer’s productivity side! That's great! I am being a fulltime VB.net developer; I find it difficult to adopt C# programming. The only reason is C# is a CASE-SENSITIVE language. So I would like to suggest MS VS dev team to provide a project level option which indicates something like "OPTION CASE SENSITIVE OFF" in C# (By default, let this option be ON).

    This project level indicator will defiantly ease developer’s pain during C# coding! I wish you will take a note of this request and I hope to see this feature implemented in VS 2010 ver.

    Even if you put this feature request for developers survey, I am sure more than 90% of developers will agree to have a feature like this!

    Thanks

    Hitesh Davey

  • Wow, there seems to be a lot of negativity here! I'm looking forward to VS2010's improvements and I believe they will counter a lot of the problems that we've experienced in 2005 and 2008. I just hope the help system doesn't take longer to appear than it takes to open a web browser and Google the answer!

    With regard to Intellisense improvements, I can see a definite copying of third-party efforts here, but that's cool. Could I make a couple of suggestions:

    - Highlight references should give me the _option_ of picking up all references, not just the specific overload (i.e. it would let me navigate all WriteLine calls in the example).

    - Make a different shortcut for activating the 'Consume First' completion mode. Isn't it just quicker to press Escape to cancel the drop-down?

    Keep up the good work and here's hoping that VS2010 will be more efficient and more productive for us all.

Page 1 of 3 (43 items) 123