CodeRush Tip - Tab to Next Reference

TabToNextReference

Tab to next Reference is one of those features that’s so simple to pick up, but once you’ve used it for even a few minutes, you’ll wonder how you ever survived without it.

It allows you to [Tab] between the references to an identifier just, as if you were tabbing between the elements of a dialog box.

Simply place your caret within an identifier, and hit the [Tab] key.

Immediately CodeRush highlights all references to the identifier, and navigates you to the next one in sequence.

Each additional press of the [Tab] key will navigate to the next occurrence of the identifier in question.

When you reach the last reference, an additional press of [Tab] will navigate back to the first instance.

Like tabbing between controls on a form, [Shift] + [Tab] will navigate through your references in reverse order.

Finally, hit the [Esc] key and your caret will jump back to where you started.

Oh and did I mention, this feature works solution wide, skipping from file to file and project to project, to locate each and every reference.

I should also point out that whilst my example on the right is in VB.Net, this feature works just as well in C#. It’s even supported in JavaScript.

Go on… Try it…

8 comment(s)
Robbert Speet
Robbert Speet

I really love these short tips, just like the (un)comment feature mentioned earlier this week.

Keep on going with these sweets!

9 April, 2011
James Zhong
James Zhong

Very nice feature that will help me much! :)

9 April, 2011
Graham Charles
Graham Charles

Just curious -- will the tab-to-next-reference respect scope rules? That is, in your example, if a different method on a different class uses the same variable name mName, will this technique move to it? I assume not, because you say "tab to next *reference*," but I thought I'd confirm.

28 April, 2011
Rory Becker - DevExpress
Rory Becker - DevExpress

@Graham Scope is indeed respected. You will not tab between references to different variables.

28 April, 2011
Jim Foye
Jim Foye

This has never worked for me. Does it need to be turned on? Or would another VS extension possibly suppress it?

1 August, 2011
Rory Becker - DevExpress
Rory Becker - DevExpress

@James Might I ask ....

...which version of CodeRush you are using? (10.2, 11.1)

...which edition (Pro vs Xpress)

...which version of studio (2008, 2010)

You see Tab To Next Reference is a feature that MS asked us to remove from CodeRush Xpress when running under VS2010.

I'm not privy to the exact reasoning for this, but If I had to guess, I'd say it was because they wanted to highlight their own Highlight References feature.

2 August, 2011
Jim Foye
Jim Foye

11.1.6 Pro

VS 2010

For some reason this has never worked for me on any machine I've installed Coderush on.

I can open a support incident, if you don't have an answer off the top of your head.

Thanks.

2 August, 2011
Rory Becker - DevExpress
Rory Becker - DevExpress

At this point, I think that would be best. Support are very skilled at puzzling these things out, and I wouldn't want you to go without this wonderful feature for any longer than necessary. :)

2 August, 2011

Please login or register to post comments.