Autocomplete annoyance with NUnit That() method?

I'm seeing some annoying behavior with R# autocomplete (R# 5.0 and VS 2010).

I'm seeing it with a method in the NUnit framework, but I'm guessing it's not specific to NUnit.

Using the Assert.That() method :

That-NotHighlighted.jpg

Notice that "SomeProperty" in the autocomplete pop-up is NOT selected.  So if I hit the Tab key at this point, a Tab is inserted instead of "SomeProperty" and I end up with :

That-Failure.jpg

However, using the Assert.AreEqual() method :

Equals-Highlighted.jpg

Now "SomeProperty" is selected and hitting the Tab key at this point inserts "SomeProperty" as expected :

Equals-Success.jpg

What's the difference between these two cases, causing autocomplete to behave differently?  And, how can I get it to work as expected in the 1st case?

1 comment
Comment actions Permalink

Hello Dave,

The difference between 'Assert.AreEqual' and 'Assert.That' is that the latter
can accept a delegate as the first parameter. So when you type 'Assert.That(f)'
ReSharper doesn't know if you're planning to write something like 'Assert.That(foo=>...)'
or something like 'Assert.That(f.SomeProperty)', so ReSharper disables the
selection in the code completion list in order to avoid accidental completion.
But after you've typed 'Assert.That(f.Som)', ReSharper should enable
selection again. Apparently this doesn't happen, so I've created a bug: http://youtrack.jetbrains.net/issue/RSRP-184253.
As a workaround, you can use Ctrl+Enter to complete the current item even
if it's not selected.

Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I'm seeing some annoying behavior with R# autocomplete (R# 5.0 and VS
2010).

I'm seeing it with a method in the NUnit framework, but I'm guessing
it's not specific to NUnit.
Using the Assert.That() method :
Image:That-NotHighlighted.jpg
Notice that "SomeProperty" in the autocomplete pop-up is NOT selected.
So if I hit the Tab key at this point, a Tab is inserted instead of
"SomeProperty" and I end up with :
Image:That-Failure.jpg
However, using the Assert.AreEqual() method :
Image:Equals-Highlighted.jpg
Now "SomeProperty" is selected and hitting the Tab key at this point
inserts "SomeProperty" as expected :
Image:Equals-Success.jpg
What's the difference between these two cases, causing autocomplete to
behave differently?  And, how can I get it to work as expected in the
1st case?

---
Original message URL:
http://devnet.jetbrains.net/message/5266462#5266462



0

Please sign in to leave a comment.