具有扩展方法的reshaper智能感知问题 [英] resharper intellisense problem with extension methods

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

问题描述

所以,我有一个使用以下方法定义的存储库:

so, I have a repository defined with a method like this:

IQueryable<Customer> Customers{...}

和其他地方的扩展方法可以像这样过滤客户:

and elsewhere an extension method to filter the customers like so:

public static IQueryable<Customer> WithID(this IQueryable<Customer> customers, int ID){...}

这很不错,让我这样使用存储库:

and this woks nicely, letting me use the repository like this:

var c = repo.Customers().WithID(5).Single();

但是问题是,ReSharper在这么大的时间搞砸了自动完成功能.当我键入

but the problem is, ReSharper messes up the Auto-Completion on this big time. When I type

var c = repo.Customers().Wi

我得到了很好的Intellisense,向我展示了WithID(...)方法,但是当我将光标向下移动并单击TAB时,它没有返回预期的WithID()方法,而是返回并更改了已编写的代码,并且线最终看起来像这样:

I get nice Intellisense showing me the WithID(...) method, but when I cursor down to it and hit TAB, instead of getting the WithID() method as expected, it goes back and changes code already written and the line ends up looking instead like:

var c = CustomerExtensions.WithID(repo.Customers())

这当然让我不得不回头再键入一次,这次是IGNORE intellisense-恕我直言,这从来都不是一件好事:)

which of course leaves me having to go back and type it in again, and this time IGNORE intellisense - which IMHO is NEVER a good thing :)

通过进入选项并为Intellisense指定"Visual Studio",我已经确认这是ReSharper问题.我不想回到普通Studio!

I have confirmed that it is a ReSharper problem by going into options and specifying "Visual Studio" for Intellisense. I don't want to go back to plain Studio!

任何人都可以提供帮助或建议解决方法吗?

Can anyone help or suggest a workaround?

推荐答案

这也影响了我.看来这是一个已知的错误:

This was affecting me as well. Looks like it's a known bug:

http://youtrack.jetbrains.net/issue/RSRP-274746

关闭Resharper->选项-> IntelliSense->完成行为->完成后自动插入括号"会有所帮助.

Turning off Resharper -> Options -> IntelliSense -> Completion Behaviour -> "Automatically insert parentheses after completion" helps.

这篇关于具有扩展方法的reshaper智能感知问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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