Can Intellisense look for classes in unimported namespaces like Eclipse for example?

In Eclipse, autocomplete works even for unused packages or namespaces. This means that if I have a class with the name DuckWrapper in the package and in the class that did not import the DuckWrapper package, I press Ctrl + space, it displays DuckWrapper and automatically imports its package if necessary.

Visual Studio, however, does not show it in its auto-complete unless I added it to the list of use first.

Can this be changed?

+7
source share
1 answer

This cannot be changed with a standard installation of Visual Studio, so you will need to install an extension to add this feature. One widely used extension that provides this feature is JetBrain ReSharper . Here is a quote from their documentation.

Import Symbol Completion (earlier completion of type input) is invoked using Ctrl + Alt + Space. Unlike Symbol Completion (which only completes the types available at the current location), ReSharper displays all types that match the specified prefix, regardless of which namespace they belong to, and automatically adds the appropriate namespace import directives when necessary. In C # code files, Import Symbol Completion works after a period using extension methods and sets the necessary ones using directives.

Import Symbol Completion

+2
source

All Articles