As the size of your code bases increases, we know just how it is important it is to be able to quickly navigate to where you want to be in your code. To this end, CodeRush provides a variety of powerful navigation tools: Tab to Next Reference, Markers, the Jump To window, and more.
In this post, we want to take a closer look at the new Code Places feature, and discuss ways to efficiently use it.
Let’s first enable Code Places from CodeRush's Visualize toolbar in Visual Studio:
The Code Places window works with C#, Visual Basic, TypeScript, and JavaScript files (*.cs, *.vb, *.ts or *.js).
Code Places displays members inside collapsed regions, presenting an outline of your code in the TextView's margin:
The Code Places window docks to the editor’s left margin by default. We can move it to the right margin instead, and we can also automatically hide it when the editor has focus.
To change Code Places settings, click the options button on the Code Places window:
In the invoked options page, enable the "Auto hide Code Places" checkbox if you prefer to only see the Code Places window when you click to invoke it, and select the right or left margin as the dock location:
Click OK.
After making these changes, the Code Places window will look something like this:
You can use the Code Places options to increase the font size, for example:
Code members are presented the order they appear in the source code, by default. You can specify a different sort criteria, such as alphabetically:
Navigation
As developers, we know it's not unusual to spend most of your day working in only a few methods. Fortunately, Code Places tracks changed members, making it easy to quickly return to those important places later when needed.
Let’s see how this works.
It's easy. Just change a method in the code editor and the Code Places window will add a “clock” icon to the right of the member name.
So now you can quickly scan through the Code Places window for the clock icons, to see recently changed members in the active file. To find methods changed in other files, look in the “Global History” tab.
Recently changed members are tracked for the active Visual Studio session. What about members you frequently need to find across sessions? Code Places lets you track these important members as favorites:
These members will always be easy to access until removed from the code or from the Favorites list.
Filtering
Sometimes a class may grow to have so many members that they do not all fit in the Code Places window. Or maybe you only recall a part of the member name. In either of these cases, you can use the search box to quickly find members matching a specified mask. Once found, jumping is as easy as clicking the filtered member. Here’s how it works:
Conclusion
We hope you find the new functionality useful and that it saves you time. If you have any suggestions for improvement, please let us know in the comments below, or contact us through Support Center. Thanks so much!