Code Filter is a productivity tool that provides a way to look at subsets of code, defined in terms of syntax elements.
The idea boils down to: "See less code, when you can".
Narrow full-text search when you know what code elements are relevant. Watch a demo.
Hide irrelevant details when you are focused on architecture or code maintenance tasks.
Currently the tool is in preview stage, a free edition is available, a pro version is work in progress.
Supports C# as it's first language.
Deployed as an extension to Visual Studio (2017, 2019 or 2022).
To install the free edition, open Extensions Manager dialog in Visual Studio and search for 'Code Filter (Free)' extension in the Visual Studio Marketplace.
Visual Studio 2017 is supported starting from version 15.7
- Open a C# project.
- Open a C# file in the editor.
- Press Ctrl + 2 to show the Code Filter tool window (or through 'View' and 'Other Windows' menu).
- Type a keyword to initiate a search.
- Type '=' to switch between views, '=+' to combine, '=-' to exclude.
- Type '==' to change search scope.
- Type '===' to repeat any of your previous searches.
- To hide the tool window press Shift + Esc.
View - a subset of code described in terms of syntax elements.
A view applied to a source file results in a list of code elements.
Examples of views:
strings view shows a list of all string literals found in the source file.
comments lists all comments.
text is the default view, shows all lines of code.
Filter - a phrase, usually split into keywords, used to filter results of a view.
'Hello World' filter applied to the text view, will show all lines that contain both words 'Hello' and 'World'.
'Hello World' filter applied to the comments view, will show all comments that contain both 'Hello' and 'World'.
If a comment is a multiline one, and the words 'Hello' and 'World' happen to be on different lines, then in the first example they won't be found, but in the second they would.
Search - one or more views combined
Certain views can be added together and result in a union of code elements from all the views.
strings and comments views can be combined, when it makes sense to search both.
Some views can be subtracted from other views, with their results excluded.
The comments view can be subtracted from the text view to exclude all comments from the code.
Scope - a set of files a search is applied to. Available scopes are:
- One or more projects
- One or more files