简体   繁体   中英

Intellisense for extension methods?

Is there a way to get intellisense for extension methods from classes that are not currently within the usings, but referenced in the solution. It would be great convenience to be able to just type and not have to add the using when using an extension method the first time in a class.

I believe what you are looking for is the Import Symbol Creation with Re#. I use this all the time when accessing members that are not part of the current using statements. In essence, Re# will look through all your referenced assemblies and see if anything matches and then provide a list of those possible matches and import if needed.

Import Symbol Completion (formerly known as Type Name Completion) displays all types that match a given prefix regardless of what namespace they belong to (as opposed to Symbol Completion, which only completes names of currently visible types). Import Symbol Completion automatically inserts appropriate namespace import directives to the current file if a selected type has not been imported previously. It also works after dot with extension methods and puts necessary using directives.

The default Re# key mapping is Ctrl + Alt + space .

I'm not sure if I updated my mappings, but I have to use: Shift + Alt + space

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