Intellisense扩展方法? [英] Intellisense for extension methods?

查看:97
本文介绍了Intellisense扩展方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以从当前不在使用范围内但在解决方案中引用的类中获取扩展方法的智能感知.第一次在类中使用扩展方法时,只需键入而不必添加using,将非常方便.

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.

推荐答案

我相信您正在寻找的是使用Re#导入符号创建.当访问不属于当前using语句的成员时,我会一直使用它.本质上,Re#将遍历您引用的所有程序集,看是否有任何匹配项,然后提供这些可能匹配项的列表,并在需要时导入.

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.

导入符号完成(以前称为类型名称完成") 显示与给定前缀匹配的所有类型,而不管是什么 它们所属的名称空间(与Symbol Completion相反,后者仅 完成当前可见类型的名称).导入符号完成 自动将适当的名称空间导入指令插入 当前文件(如果先前未导入所选类型).它 也可以在点后使用扩展方法,并在必要时使用 指令.

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.

默认的Re#键映射为 Ctrl + Alt + space .

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

我不确定是否更新了映射,但是必须使用: Shift + Alt + space

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

这篇关于Intellisense扩展方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆