shekharpro / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

ALT+ENTER Shortcut options disabled using Resharper 4.5 #430

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install Resharper 4.5 Gold, no tweaks to Options
2. Create a Class Library project using VS 2008 SP1, inside the class drop
the code:

    public class Class1
    {
        int m_foo;

    }

3. While cursor is inside "m_foo", press ALT+ENTER.  Should see options like:
 - Remove unused field
 - Comment unused field
 - Initialize field from constructor(s) paramter
 - Rename to '_mFoo'
 - Change setings for rule 'Instance fields (not public)'
 ------
 - Suppress inspection with #pragma
 - Suppress inspection with comment
 - Inspections options for "Inconsistent Naming"

4. Close VS
5. Install GallioBundle 3.0.6.763 x86 (or v3.0.7.48), using "Custom" setup
6. Re-open VS 2008 project from Step #2
7. While cursor is inside "m_foo", press ALT+ENTER.  Now you only see the
options:
 - Rename to '_mFoo'
 - Change setings for rule 'Instance fields (not public)'
 ------
 - Suppress inspection with comment
 - Inspections options for "Inconsistent Naming"

Something is eating Resharper shortcuts inside the Plugin.

Original issue reported on code.google.com by brettvee...@gmail.com on 21 Apr 2009 at 12:16

GoogleCodeExporter commented 8 years ago
ReSharper (actually Visual Studio) has a known bug where it will lose key 
mappings
whenever ANY other Visual Studio package is installed.

Basically, whenever "devenv.exe /setup" is run (usually as part of package
installation) some stuff goes missing.

So the problem is not unique to Gallio and there's nothing I can do about it.

Sorry.

Original comment by jeff.br...@gmail.com on 21 Apr 2009 at 9:27

GoogleCodeExporter commented 8 years ago
Thanks for the quick reply.

Perhaps I've confused the issue.

I can still use ALT+ENTER, it's just that not all the Resharper *choices* are 
available.

If I UNINSTALL Gallio Bundle, I get the options back...

Original comment by brettvee...@gmail.com on 22 Apr 2009 at 2:02

GoogleCodeExporter commented 8 years ago
UPDATE:
If I do NOT touch any installation, but simply disable "Gallio Test Runner" 
from the
R# Plugins Menu, the missing options are back.

Test Runner v3.0.7.0
R# 4.5.1231.7

Original comment by brettvee...@gmail.com on 22 Apr 2009 at 11:48

GoogleCodeExporter commented 8 years ago
I can assure you we make no changes at all to the key mappings.  We don't hook 
any
handlers at all.  If you re-enable Gallio Test Runner are the options gone 
again?  I
could see how just opening up the options dialog might give R# a chance to fix 
itself up.

I recommend contacting JetBrains.

Original comment by jeff.br...@gmail.com on 22 Apr 2009 at 5:31

GoogleCodeExporter commented 8 years ago
If I re-enable the Plugin, only these R# options appear:

 - Rename to '_mFoo'
 - Change setings for rule 'Instance fields (not public)'
 ------
 - Suppress inspection with comment
 - Inspections options for "Inconsistent Naming"

If I disable the Plugin, I get those above, plus:
 - Remove unused field
 - Comment unused field
 - Initialize field from constructor(s) paramter
 - Suppress inspection with #pragma

So, with Gallio Plugin active, I still get Resharper functionality, just less 
choices.

If you still think it's a Jetbrain's thing, I'll take it up with them.  Is there
anywhere I can look to help fix this?  I don't want to just "dump" stuff on 
you, but
the codebase is rather large and I'm not sure where to begin!  :)

Thanks again for your time replying.

Original comment by brettvee...@gmail.com on 22 Apr 2009 at 6:55

GoogleCodeExporter commented 8 years ago
Ok, I think I understand better now.  It's not that ALT-ENTER became unmapped 
it's
that some choices are missing.  The former is a known bug the latter is new to 
me.

I feel a little stupid because you've been saying that all along and I 
misinterpreted
it.  Sorry!

In any case, I still have no clue what's going on.  All Gallio does is hook up 
an
IUnitTestProvider which R# calls into.

However R# v4.5 does populate some information in the background which takes 
time
(unavoidably).  It's possible that it builds certain caches only after calling 
into
the unit test provider in which case that information might not be refreshed
immediately so some ALT-ENTER options could be absent.  Still just a theory.

You'll find the code in src\Extensions\ReSharper\Gallio.ReSharperRunner in the 
source
tree.  However I don't expect it will do you any good since none of the code 
directly
influences R#'s hints.

Tell you what, I'll send a link to this issue to Ilya at JetBrains and see what 
he
thinks about it.

Original comment by jeff.br...@gmail.com on 22 Apr 2009 at 7:03

GoogleCodeExporter commented 8 years ago
Ah ha!  You were right.  Sorry I ever doubted you... now that I understand the 
action
principle I can get down to fixing the problem!

---

Jeff,

You seem to misreport entities as IsUnitTestStuff in your provider. If 
something is
related to unit testing, it is very likely to be used indirectly, like SetUp,
TearDown, Tests, etc. So analysis doesn't mark those elements as unused, hence 
no
quick fixes on them. 

Ilya Ryzhenkov

Original comment by jeff.br...@gmail.com on 23 Apr 2009 at 8:32

GoogleCodeExporter commented 8 years ago
Thanks for all the followup on this Jeff!  

I'd be happy to test out a nightly build when you get to it.

Original comment by brettvee...@gmail.com on 23 Apr 2009 at 9:11

GoogleCodeExporter commented 8 years ago
Fixed in v3.0.6 Update 2.

You can try a nightly from http://ccnet.gallio.org/Distributables/

Original comment by jeff.br...@gmail.com on 28 Apr 2009 at 6:21

GoogleCodeExporter commented 8 years ago
You nailed it Jeff!  Thanks!

Original comment by brettvee...@gmail.com on 29 Apr 2009 at 12:24