Code Inspection analyzes for specific code quality issues as you edit. The feature, based on LLVM/Clang, warns you of issues in your code and if possible, suggests and applies quick fixes.
Enable Code Inspection in the options dialog for Visual Assist.
Individual code issues are listed in a tool window and highlighted in the text editor. The first few characters of an issue are underlined.
Access in the Text Editor
When enabled, code issues are highlighted in the text editor. The first few characters of most code issues are underlined, in solid or dotted fashion. To understand an issue, hover over the underlined characters.
If the issue underline is solid or issue is dimmed, a quick fix is available. If the issue underline is dotted, a fix is not available.
Access to a quick fix is available via mouse or keyboard. If the option to display tomato icons is enabled in the options dialog for Visual Assist, quick fixes are available by mouse.
Hover over an issue and click its tomato icon to access the fix.
Whether or not tomato icons or highlighting via underlines are enabled, fixes are always available in the Quick Actions and Refactorings menu (Shift+Alt+Q), invoked when the caret is on the first characters of an issue.
Accept a fix to apply it.
Access in the Tool Window
Open the VA Code Inspection Results to see all code issues for the current file, whether or not their underlining is enabled.
By default, issues are sorted by line number.
Double-Click an issue in the tool window to bring it into view in the text editor.
Fixes in the tool window are available via its context menu.
Fixes can be applied to single or multiple selections.
Grouping in the Tool Window
Use the context menu in the tool window to group issues by code inspection or level.
When grouped, apply fixes to all issues for a group by opening the context menu on the group row.
When grouped, sort order applies to issues within each group. Change sort by clicking column headers.
Enabled tracking in the tool window to have its contents scroll as you move within the text editor.
When tracking is enabled, the selection in the tool window changes when the caret in the editor lands on a code issue, whether or not issues are underlined.
Ticks in the scroll bar of the text editor identify locations and levels of code issues. Hover over a tick for details.
Ticks that represent multiple issues contain details for all of them, omitting duplicates.
Select a tick to bring it into view.
Ticks can appear whether or not underlining is enabled.
Enabling/Disabling of Individual Inspections
Individual code inspections can be enabled/disabled in the options dialog for Visual Assist.
Individual inspections can also be disabled in the tool window. Disabling is available whether or not code issues are grouped. Enabling of inspections from the tool window is not available.
Individual inspections cannot be enabled/disabled from the text editor.
When disabled, code issues for the affected inspection do not appear in the text editor or tool window. If you want to see code issues in the tool window but not in the text editor, disable only their underlining and appearance in the scroll bar; enable the individual inspections.
Individual code inspections are automatically inactive when the toolset for the current project does not support their respective quick fixes, e.g. declaration of a variable using 'auto', which was introduced in C++11.
Code inspection levels represent roughly severity, with level one being critical and five a notice. Re-assign levels in the options dialog for Visual Assist.
Levels vary in the user interface only by color. No other functionality is affected, with an exception for level five. Level five issues are dimmed, not underlined.
Quick fixes can be undone only in the text editor, even if fixes are applied from the tool window. For fixes applied to a group, one undo reverts all of the fixes.
By default, the LLVM/Clang parser underlying Code Inspection becomes active only when there is a pause in editing. The Code Inspection parser is independent of the built-in and Visual Assist parsers that provide IntelliSense and other coding assistance. But unlike parsing for IntelliSense, Code Inspection requires parsing of only the active file.
Disable automatic re-parsing if it interferes with the responsiveness of Visual Studio. Disable automatic re-parsing also if you view code issues only in the tool window, i.e. you have disabled their underlining and ticks in the scroll bar.
Manually parse for code issues in the tool window. The button to parse is enabled only when automatic re-parsing is disabled.
Visual Studio 2008 and older
Code Inspection is not available.