Is it possible for Intellisense to search for classes in unimported namespaces like in Eclipse?
This kind of feature exists in current version of Visual Studio 2019 but it is still experimental.
As you can see in the image above, you can't see the entity Student
from the namespace Test2 that's in another project but if you click button in the bottom left corner of IntelliSense window, you will see this.
Upon accepting Student option that IntelliSense gives, all needed namespaces will automatically be added at the top of your file (or bellow all the existing using statements above the namespace name).
You can turn this option on/off in:
- Tools
- Options
- Text Editor
- C#
- IntelliSense
- Check/Uncheck the last option 'Show items from unimported namespaces (experimental)
EDIT: I embedded the images instead of just hyperlinking them.
You may use the IntelliSense Extender Plugin. For Visual Studio 2017:
https://marketplace.visualstudio.com/items?itemName=Dreamescaper.IntelliSenseExtender
And for VS 2019:
https://marketplace.visualstudio.com/items?itemName=Dreamescaper.IntellisenseExtender2019
It includes the types of all projects in the solution and of all referenced packages. Selecting an not imported type from IntelliSense will then auto import that type.
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.
Import Symbol Completion (formerly Type Name Completion) is invoked with Ctrl+Alt+Space. Unlike Symbol Completion (which only completes types accessible at the current location), ReSharper displays all types that match a specified prefix regardless of what namespace they belong to, and automatically adds the appropriate namespace import directives when necessary. In C# code files, Import Symbol Completion works after dot with extension methods and puts necessary using directives.