Lattice intellisense problem with extension methods

so I have a repository defined using a method like this:

IQueryable<Customer> Customers{...} 

and elsewhere, an extension method for filtering such clients:

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

and this woks is beautiful, allowing me to use the repository as follows:

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

but the problem is that ReSharper ruined autocomplete at this big time. When i type

 var c = repo.Customers().Wi 

I get a nice Intellisense showing me the WithID (...) method, but when I iterate before it and press TAB, instead of getting the WithID () method, as expected, it returns and changes the code already written and the line ends by what looks like this:

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

which, of course, leaves me to go back and re-enter it, and this time IGNORE intellisense, in which IMHO is NEVER good:

I confirmed that this is a ReSharper problem by going to the options and specifying "Visual Studio" for Intellisense. I do not want to return to simple Studio!

Can someone help or suggest a workaround?

+8
extension-methods resharper intellisense
source share
2 answers

It affected me too. This seems to be a known bug:

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

Disabling Resharper -> Options -> IntelliSense -> Termination Behavior -> "Automatically insert brackets after completion."

+5
source share

You can call it as an extension method using type completion (CTRL + ALT + SPACE), and this will bypass the error correctly.

This error occurs only for certain extension methods, I do not know why.

0
source share

Source: https://habr.com/ru/post/650771/


All Articles