9

I love the "Resolve" feature in visual studio.

Typical scenario:

  1. Type in Debug
  2. Type .
  3. Notice that no intellisense appears
  4. Right-click
  5. Select Resolve
  6. Choose using System.Diagnostics or System.Diagnostics.Debug

Beautiful. Use it all the time.

Extension method scenario:

  1. Type in var maxNumber = new int[] {1, 2, 3, 4}
  2. Type .
  3. Notice that intellisense brings up array methods but no LINQ extension methods
  4. Manually type Max()
  5. Right-click Max()
  6. No Resolve to be found
  7. Right click on int[]
  8. Still no Resolve to be found
  9. Begrudgingly scroll to the top of the page and enter using System.Linq;*

    *assuming you know it by heart, otherwise wrack your brains or try to look it up

Implementation idea:

If this feature were to be invented, one idea would be for the first intellisense item that appears when I type . to read, <extension methods...>, and if I click that item, it brings up a Resolve list of all namespaces that contain extension methods for the class in question.

Couple questions:

  1. Is this feature slated for future editions of Visual Studio?
  2. Any workarounds/tips for finding the extension methods (and the corresponding namespace) that might be available for a particular class?
2

1 Answer 1

1

I really HATE having to "just know" what namespace to use to support any given class. I mean, there are THOUSANDS OF THEM. Who knows what namespace you need? There's no naming convention that can be used as a clue.

It's a shame because I also use Netbeans IDE for Java, and "resolve imports" works flawlessly for everything.

2
  • 4
    Does Java even have extension methods? Like the OP says it works just fine for the typical usage, probably just as flawlessly as in NetBeans IDE for Java.
    – lucidquiet
    May 29, 2012 at 18:38
  • There is no extension methods for java. Beside this I also love Eclipse's "organize imports" feature, and importing packages are faster because it automatically imports the packages. Beside this .NET has many extremely-good features now. I do not want to make an annoying comparison about it... Apr 5, 2013 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.