简体   繁体   中英

How get IntelliSense hints for 3rd party classes as you type in Visual Studio 2019?

Currently, I get no IntelliSense hints for classes that are in 3rd party packages that I have not yet imported with using .

For example, if i type ConnectionMul I get no hints, so I have to instead type the entire classname ( ConnectionMultiplexer ) and then type Alt+Enter and only then does it suggest using StackExhange.Redis .

I'm used to IntelliJ's hinting with Java. When I have dependencies added to the project, I can just type Con and it will already have suggestions including the 3rd party classes. Is there a way to do this in Visual Studio?

If you've already referenced the type in your project (via assembly or NuGet package), it should show up as a lightbulb action when you've typed a partial match:

显示通过灯泡动作完成类型名称的建议

However, it seems that this requires at least 5 charactes typed - when I try it with JObj I don't get the suggestion, but with JObje I do.

There are also (for completeness) options under the C# language that suggest using statements from NuGet or the local reference assemblies path once you've typed out the type name:

工具 - >选项 - >文本编辑器 - > C# - >高级,显示'建议使用NuGet包中的类型'复选框

When this is turned on and you use a type not referenced in your project, you'll see a suggestion like this:

显示灯泡操作以从NuGet安装包

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM