Resharper autocomplete the wrong method

Resharper correctly suggests and pre-selects the generic version of the method that I want to execute. However, after pressing 'Enter', it automatically terminates another method.

The right method

Invalid method completed

enter image description here

How is this possible and how can I fix it?

Resharper 10.0.2

Update for Visual Studio Community 2015 1

Unity 5.3.1f1

+5
source share
5 answers

It looks like you are experiencing the same R # error as on your next YouTrack ticket . This problem has been fixed in the R # 10.1 branch and will be available in the ReSharper 10.1 release.

+3
source

Either this is a bug, or a feature that is not available in your version, but in R # 9.2, behavior is what you expect.

So, if you are in R # 10, you can try to lower your current license (or upgrade if you are in R # with a lower version, IMHO, upgrading to a higher version is free if I remember well).

By the way, if MuhKuh is right on R # 10, then you can select " <YourType> " if there is no hidden configuration field to return to the inherited behavior.

Check here for all possible versions.

+1
source

I had this problem recently, but in monodevelop, so I don't think this is a mistake - the only way to solve the problem is to carefully study your code and rename everything that uses the same name as your method (which the code has access to )

+1
source

This is not an automatic completion error. What you see here are two different ReSharper functions.

The first is automatic completion, which shows the available overloads. The second (after accepting with Enter) is the best candidate for the parameters you enter.

I'm not sure which algorithm they use, but you can simulate this behavior by creating 2 such methods.

 public void Test(int val) { } public void Test(string val) { } 

You will notice that depending on whether you enter the number or start typing "for the string", the pop-up window will switch to the correct overload.

0
source

I think this is the correct intellisense.

This will separate the two conditions.

  • map.AddComponent (): hint AddComponent (Type) and AddComponent (string)

  • map.AddComponent (): hint AddComponent ()

you should enter map.AddComponent to complete it

0
source

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


All Articles