Code Issues navigation techniques
Analyzing the quality of your source code may take some time, especially if there are hundreds or thousands of code issues. While checking the code issues, you have to navigate thought all of them inside the entire solution. Here are available navigation techniques to switch between code issues:
- Code Fix hint
- Keyboard shortcuts
- Code Issues tool window
Code Fix hint
The hint appears inside the Visual Studio code editor or at the left view bar when you hover the mouse at the code issue highlighting. This hint has two green navigation buttons that allow you to switch between code issues inside the active source file. You can navigate to the next or previous code issue:
If there is no next or previous issue – the corresponding button becomes disabled:
If you hover the mouse over one of these buttons, you can see the keyboard shortcuts currently assigned for the navigation actions:
Shortcuts
If you hovered the mouse over the navigation buttons, you’ve already learned the keyboard shortcuts to switch between issues of the current source file. The default shortcuts are: Alt+Page Down to go to the next issue and Alt+Page Up to go the previous issue. You may change these shortcuts on the Shortcuts options page of the Options Dialog:
Once the shortcut is pressed, you will be navigated to the nearest code issue from the caret position and the Code Fix hint will show up. Here you can apply the fix using other keyboard shortcuts (e.g. Tab and Enter):
Tool Window
The Code Issues tool window contains the list of code issues found in the entire solution:
The list requires using the mouse to switch between code issues. Once you double-click an issue, the appropriate source file will be activated inside the IDE and the caret will be positioned right over the chosen code issue, after that you can review the source code and make necessary changes if required. Bear in mind that using the navigation from the tool window will also leave you with a system gray marker at the previous caret position, so you can easily move back to the original location if necessary.
This post is a part of post series about CodeRush Code Issues technology. To learn more about code issues, please refer to the appropriate topics:
- Code Issues technology overview
- Code Issues types overview
- Code Issues visual presentation
- Code Issues fixes and suppression
- Code Issues navigation techniques (current post)
- Code Issues tool window
- Code Issues configuration and options
- Code Issues overall list
- Creating your own code issue