问题描述
在Eclipse中,即使没有使用的包或名称空间,自动完成功能也可以使用.这意味着,如果我在一个包中有一个名为DuckWrapper的类,并且在没有导入该包DuckWrapper的类中,我按ctrl + space,它将显示DuckWrapper并在必要时自动导入其包.
In Eclipse, autocomplete works even for unused packages or namespaces. That means that if I have a class named DuckWrapper in a package, and in a class that didn't import the package DuckWrapper I press ctrl+space, it will display DuckWrapper and automatically import its package if necessary.
但是,Visual Studio不会在其自动补全中显示它,除非我先将其添加到使用列表中.
Visual Studio however, doesn't show it in its autocompletion unless I added it first to the using list.
可以更改吗?
推荐答案
在Visual Studio的标准安装中不能对此进行更改,因此您需要安装扩展程序才能添加功能.提供此功能的一个常用扩展名是 JetBrain的ReSharper .这是他们文档中的引言.
This cannot be changed in a standard installation of Visual Studio, so you would need to install an extension to add the feature. One commonly used extension which provides this feature is JetBrain's ReSharper. Here is a quote from their documentation.
这篇关于像Eclipse中一样,Intellisense是否有可能在未导入的名称空间中搜索类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!