views:

68

answers:

2

I used to program quite a lot in Java, recently I've began to work with C#. I think that most of advantages of C# (comparing to Java) are corrupted by VS.

Now what really makes me crazy is intelisence. It offers only list of classes of that are already in "using". I would like to see suggestions of all classes from all libraries. Then, when I finally remember the name of class I want to use and type it manually I have to confirm "using"(by clicking pop-up(!)). This is cost me some time and makes me nervous. Most important of all then I'm choosing between methods or classes, filling parameters of methods etc. I need to see documentation of those classes, methods etc. VS displays just a small tool tip that is contains only summary what is completely unsatisfactory. It does not even contain methods return type(!) and parameters.

Resharper does not solve any of these. Its suggestions are also mostly useless(it suggest actions I don't want to do). As well I'd like to see Resharper's sugestion not only when I'm on the line in task.

Can somebody suggest a solution ? Maybe some addon, how to change it in settings or alike? Other productivity features or a way how to "generally" set shortcuts to be the same as in Java would be also appreciated.

Edit: This is what happens if I press Ctrl+Space or Ctrl+Space+Shift(Reshaper?) inside just after "(" of some method:alt text

What I want it to do is to have list of methods(ideally with parameters types and return type) like the on on top of the picture that I can switch between using arrows but also a full documentation(in another popup, docked window...) that would look like this:alt text

+1  A: 

A cool trick I learned recently that might help you is Ctrl + .. Instead of clicking the popup to add the using statement, you can press Ctrl + . to bring up the popup with the "add using statement" item already selected. Then all you have to do is press Enter and VS will add the using statement for you.

Also, Intellisense will show you the return type/signature and description of methods, you just need to wait a moment after one becomes highlighted in the Intellisense list.

Zach Johnson
+1  A: 

VS only shows Classes and Methods available in current scope, but if you type the name of the class it suggests you to add a using. To confirm the using you just need to press CTRL + . + Enter.

It DOES contain return type and params, to see the params press CTRL + SHIFT + SPACE between ( and ).

You don't need to open the documentation, you can press F12 (or right click and Go To Definition), there you see all the documentation, for example String.Format

//
// Summary:
//     Replaces the format item in a specified string with the string representation
//     of a corresponding object in a specified array. A specified parameter supplies
//     culture-specific formatting information.
//
// Parameters:
//   provider:
//     An object that supplies culture-specific formatting information.
//
//   format:
//     A composite format string.
//
//   args:
//     An object array that contains zero or more objects to format.
//
// Returns:
//     A copy of format in which the format items have been replaced by the string
//     representation of the corresponding objects in args.
//
// Exceptions:
//   System.ArgumentNullException:
//     format or args is null.
//
//   System.FormatException:
//     format is invalid.-or- The index of a format item is less than zero, or greater
//     than or equal to the length of the args array.
[SecuritySafeCritical]
public static string Format(IFormatProvider provider, string format, params object[] args);

CsharpDoc

As for your methods you can create the documentation, as the following example shows:

/// <summary>
/// Convert a number to string
/// </summary>
/// <param name="number">An integer number to be converted to string</param>
/// <returns>Number as string</returns>
/// <example>
/// <code>
///     var s = MyMethod(5);
/// </code>
/// </example>
/// <seealso cref="Int32.ToString()"/>
/// <exception cref="Exception">In case it can't convert</exception>
/// <remarks>
/// Whatever you want to add here, so it gets better.
/// </remarks>
public string MyMethod(int number)
{
    return number.ToString();
}
BrunoLM
Thanks for answer. See edit to my question, Ctrl+Space+Shift does the some for me as Ctrl+Space(Resharper?).
drasto
CTRL+SHIFT+SPACE between ( and ) shows parameters using arrow keys you can see all overloads. CTRL+SPACE on the method name shows information about it: return type, summary, exceptions. I don't know if you can configure it to show more information, maybe you can... (without resharper)
BrunoLM