VS中的生产力功能,如何显示文档

时间:2010-05-15 02:36:13

标签: c# visual-studio keyboard-shortcuts resharper

我曾经在Java中编写了很多程序,最近我开始使用C#。 我认为C#的大部分优点(与Java相比)都被VS破坏了。

现在让我疯狂的是智慧。它仅提供已在“使用”中的类列表。我希望看到所有图书馆所有课程的建议。然后,当我终于记住我想要使用的类的名称并手动输入时,我必须确认“使用”(通过单击弹出窗口(!))。这花了我一些时间让我感到紧张。 最重要的是我在方法或类之间进行选择,填充方法的参数等。我需要查看这些类,方法等的文档.VS仅显示一个小工具提示,其中仅包含完全不满意的摘要。它甚至不包含方法返回类型(!)和参数。

Resharper没有解决任何这些问题。它的建议也大多没用(它建议我不想做的动作)。我也希望看到Resharper的消息不仅在我上任务时。

有人可以提出解决方案吗?也许是一些插件,如何在设置或类似的地方改变它?其他生产力功能或如何“通常”设置快捷方式与Java相同的方式也将受到赞赏。

修改:如果我在“(”某些方法之后按Ctrl+SpaceCtrl+Space+Shift(重塑?),会发生这种情况:alt text http://www.freeimagehosting.net/uploads/ceaeae7c92.png < / p>

我想要它做的是拥有方法列表(理想情况下是参数类型和返回类型),如图片顶部的on,我可以使用箭头切换,还有完整的文档(在另一个弹出窗口,停靠)窗口......)看起来像这样:alt text http://www.freeimagehosting.net/uploads/109ca8417c.png

3 个答案:

答案 0 :(得分:1)

我最近学到的一个很有用的技巧可能是 Ctrl +。。您可以按 Ctrl +。来显示已选中“add using statement”项的弹出窗口,而不是单击弹出窗口以添加using语句。然后你要做的就是按 Enter ,VS会为你添加using语句。

此外,Intellisense将向您显示方法的返回类型/签名和描述,您只需要在智能感知列表中突出显示一个方法后稍等片刻。

答案 1 :(得分:1)

VS仅显示当前范围内可用的类和方法,但如果您键入类的名称,则建议您添加using。要确认使用,您只需按 CTRL + + 输入

它包含返回类型和参数,以查看参数在(和{之间按 CTRL + SHIFT + SPACE {1}}。

您无需打开文档,可以按 F12 (或右键单击并转到“定义”),在那里您可以看到所有文档,例如)

String.Format

CsharpDoc http://img27.imageshack.us/img27/7597/intelisense.png

至于您的方法,您可以创建文档,如以下示例所示:

//
// 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);

答案 2 :(得分:0)

点击Ctrl+Shift+F1即可使用ReSharper的快速文档。 然后出现一个带有大量信息和导航的黄色窗口。

enter image description here

相关问题