Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resharper intellisense problem with extension methods

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();

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

var c = repo.Customers().Wi

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())

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 :)

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?

like image 372
Travis Laborde Avatar asked Jan 06 '11 19:01

Travis Laborde


1 Answers

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

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

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

like image 105
user891603 Avatar answered Oct 25 '22 12:10

user891603