Showing posts with label Tip. Show all posts
Showing posts with label Tip. Show all posts

Thursday, February 18, 2010

Enhance QuickNav (CodeRush or CodeRush Xpress)

Update: DevExpress have removed the QuickNav feature from CodeRush Xpress 10.1 and higher (when used under VS2010) at the request of Microsoft. It is believed that this is because it overlaps in functionality with one of the VS2010's new features. Since Microsoft licensed CodeRush Xpress on behalf from DevExpress for all users of VS2008 and VS2010 (Pro and above), this is not completely unreasonable. This feature remains in the Pro version of CodeRush


QuickNav (Ctrl+Shift+Q) is an often overlooked but useful tool in the CodeRush (and Xpress) box.

With it you can search through your code pretty quickly… provided, that is, you configure it for the type of search you’re trying to do.

QuickNavigation

I don’t know about you but I often go kinda snow blind looking at all those icons for “Public property”, “Friend Method”, “Private Class”

However what very few people seem to know, is that you can preconfigure QuickNav to behave differently based on how you launch it.

That’s right you can create your own shortcuts (keystrokes) to launch QuickNav preconfigured for a specific type of search.

By adding just a couple of keystrokes, QuickNav can become IMHO a much more useful facility.

The 2 shortcuts I’m going to suggest I’m going to call “Find Types in Solution” and “Find Types and Members in File”. These are more descriptions of what they will do, rather than the names they will be given.

To add these shortcuts, follow the instructions in my previous post Binding a key in CodeRush and enter the information below in the appropriate boxes. At this point you will have added 2 very useful tools to your box o’ tricks

Find Types in Solution
Bind to : Suggest Ctrl+T
Command: QuickNav
Params: AllTypes, , AllVisibilities, CurrentSolution

Find Types and Members in CurrentFile
Bind to : Suggest Ctrl+M
Command: QuickNav
Params: AllTypes, AllMembers, AllVisibilities, CurrentFile

These bindings should allow you to navigate your code even easier than before :)

For reference, I will now quote from an early forum post by AlexS in which he details the possible parameters for the QuickNav command

-------------------------------------------------------------
There are 4 parameters for the QuickNav action:

TypeFilter -- defines default type filter for the Quick Navigation.
Use the following values to setup default type filter: Classes, Interfaces, Structs, Enums, Delegates, AllTypes.
Use "and" keyword to combine filters together like this: Classes and Structs
MemberFilter -- defines default member filter for the Quick Navigation.
Use the following values to setup default member filter: Methods, Properties, Events, Fields, LocalsAndParams, AllMembers.
Use "and" keyword to combine filters together like this: Methods and Properties.
AccessFilter -- defines default access filter for the Quick Navigation.
Use the following values to setup default access filter: Private, Protected, Internal, ProtectedInternal, Public, AllVisibilities.
Use "and" keyword to combine filters together like this: Private and Protected.
LocationFilter -- defines default location filter for the Quick Navigation.
Use the following values to setup default location filter: AllFiles, CurrentSolution, CurrentProject, CurrentNamespace, CurrentFile.
You can not use "and" keyword here to combine filters together.
Here are examples of parameters usage:

AllTypes, AllMembers, AllVisibilities, CurrentFile
AllTypes, AllMembers, AllVisibilities, AllFiles
AllTypes, AllMembers, Public and Protected, CurrentFile
-------------------------------------------------------------

Thursday, January 29, 2009

VSTricks

If you haven’t seen it already, I suggest that you check out the VSTricks section of Scott Cate’s site.

The introduction is here but for the lazy…

Sara Ford recently (well December) finished her 17 month long “Visual Studio (2005/2008) - Tip of the day” series. (That’s 382 posts.) The posts are obviously still there (check out VS2005Tips,VS2008Tips) to be read by anyone who cares to drop by.

Since then however Scott has taken it upon himself to declare “My hope is not only to enhance your (Sara’s) original Tip Of the Day posts by adding video samples, but also continue to create new posts for tips and tricks from the Visual Studio team.”

No small order considering the amount of time taken to create, edit, upload and host that many videos. Still he’s off to a great start with already 30 videos up at the time of posting. I have already subscribed to the VSTricks Rss feed, and you should too.

So please stop by and check it out.. I’m sure there’s something there you didn’t know and keep checking back as Scott has set himself one hell of a challenge and will need all the support he can muster in order to keep going. :)


Friday, December 07, 2007

Plugin Development under Vista 64-bit

There are a minor issue affecting the development of plugins under 64-bit vista.

The basic issue is that your installation of Visual studio (assuming that you go for the defaults) will be under "C:\Program Files (x86)\" and defaults in a plugin project (and indeed other types of project) will point to a directory under "C:\Program Files\".

Now CodeRush /Refactor/DXCore will all install (by default) also under "C:\Program Files (x86)\" and it seems very hard to convince the OS to allow anything else.

All this means that you will compile and build plugins to a directory ( C:\Program Files\..etc..") which the DXCore is not looking in.

The simplest way I have found to solve this is to use a program like Junction Link Magic to create a "Junction Point" between a new Empty folder created at "C:\Program Files\Developer Express Inc\" and the real folder at "C:\Program Files (x86)\Developer Express Inc\".

A "Junction Point" is a "Magic Portal" between the empty folder and the specified destination. The effect of which, is to fool the FileSystem, and hence every program that makes use of it, into seeing all the files in both locations.

It should be noted that there is only one set of files, they are just visible in 2 places. If you delete anything it will vanish from both locations

So once this is done you can happily compile Dlls to one location and run them through DXCore from the other.


Monday, March 12, 2007

Coderush Tip #1: Show References

In CodeRush 2.1.3, a feature called "Show References" was added.In CodeRush 2.1.3, a feature called "Show References" was added.

This feature allows one to 'Tab' through all references to a given variable/method. Simply locate your caret within the token of your choice and hit 'Tab'.
Your caret jumps to the next reference to that token in question.

Hit Shift-F12 (The default 'Show References' keycombo) and up pops the References Tool panel, to show you every reference to the given token in your entire solution.

Go on... Try it with int32 and see how quickly it works.

Now I couldn't leave well enough alone, and deciding that even this was too slow. (Sorry Mark :) ), I resolved to find a quicker way to access this functionality.

It was a very simple idea but one that seemed to gel better in my head.

Basically I changed the keystroke that fires this marvellous facility from [Shift-F12] to [Enter].

To paraphrase something that Mark Miller has said a few times.
Why make somebody push 2 keys when they can press 1?

So if you'd care to follow these few instructions, we'll see if we can't make life a little easier and reduce (by a very small measure) the chances of you suffering RSI.
(Note to reader: Actual chance of suffering RSI may increase as a result of taking this advice due to further addiction to CodeRush and hence coding)

1. First locate the 'DevExpress' menu in Visual Studio and select 'Options'
2. Next locate and select from the tree of options on the left, a branch entitled IDE\Shortcuts.
(Rather than remove the [Shift-F12] keystroke, we'll copy it.)

3. Locate the existing Shortcut in Navigation\References and right-click it.
4. Select 'Duplicate shortcut'
5. Select either the original or the duplicate and alter 'Key 1' so that it reads [Enter] (without brackets).
6. Change the context (the tree of checkboxes in the bottom right) to additionally check the 'System\In Nav Field' context.

7. Click 'Ok'

You're all done

Enjoy