ReSharper 2021.1 Help

Using Filters in Code Completion

ReSharper allows you to filter completion suggestions by kind of symbol, access modifiers, and so on. You can modify the set of applied filters each time the code completion is invoked and/or choose to keep the state of filters.

By default, ReSharper shows filters bar at the bottom of the completion popup. In this bar, you can see the state of filters and click the icons to enable or disable specific filters.

Filters in completion popup

If necessary, you can hide the filters bar and configure other related options on the Environment | IntelliSense | Completion Filters page of ReSharper options.

Persisting state of filters

By default, completion filters you specify are reset each time you invoke code completion. If necessary, you can keep the last modified state of filters. To do so, select Persist filters on the Environment | IntelliSense | Completion Filters page of ReSharper options.

When this checkbox is selected, you can optionally modify the default state of filters. Note that these filter state controls are synchronized with the filter bar in the completion popup.

Filter modes

You can use each filter either to include or exclude suggestions of specific kind.

'Include' mode

To include only specific kinds of suggestions in the completion list, left-click the corresponding icons on the filter bar. The filter icons for included items get highlighted with a solid background.

In the example below, only namespaces are included in the list:

ReSharper completion filters: 'include' mode

'Exclude' mode

To exclude specific kinds of suggestions from the completion list, right-click the corresponding icons on the filter bar. The filter icons for excluded items get highlighted with a border.

In the example below, everything except namespaces is excluded from the list:

ReSharper completion filters: 'exclude' mode

Shortcuts for completion filters

By default, completion filters have no shortcuts, but you can assign a shortcut to any filter. The table below lists aliases for each filter action. You can use this aliases to find and assign specific shortcuts in Visual Studio options. (Tools | Options | Environment | Keyboard ).

FilterAction aliases (include/exclude)
NamespacesReSharper_IntelliSenseFilterNamespaces/ ReSharper_IntelliSenseFilterNamespacesInvert
ClassesReSharper_IntelliSenseFilterClasses/ ReSharper_IntelliSenseFilterClassesInvert
InterfacesReSharper_IntelliSenseFilterInterfaces/ ReSharper_IntelliSenseFilterInterfacesInvert
StructsReSharper_IntelliSenseFilterStructs/ ReSharper_IntelliSenseFilterStructsInvert
EnumsReSharper_IntelliSenseFilterEnums/ ReSharper_IntelliSenseFilterEnumsInvert
DelegatesReSharper_IntelliSenseFilterDelegates/ ReSharper_IntelliSenseFilterDelegatesInvert
EventsReSharper_IntelliSenseFilterEvents/ ReSharper_IntelliSenseFilterEventsInvert
MethodsReSharper_IntelliSenseFilterMethods/ ReSharper_IntelliSenseFilterMethodsInvert
FieldsReSharper_IntelliSenseFilterFields/ ReSharper_IntelliSenseFilterFieldsInvert
PropertiesReSharper_IntelliSenseFilterProperties/ ReSharper_IntelliSenseFilterPropertiesInvert
ParametersReSharper_IntelliSenseFilterParameters/ ReSharper_IntelliSenseFilterParametersInvert
Local VariablesReSharper_IntelliSenseFilterLocalVariables/ ReSharper_IntelliSenseFilterLocalVariablesInvert
Public membersReSharper_IntelliSenseFilterPublic/ ReSharper_IntelliSenseFilterPublicInvert
Internal membersReSharper_IntelliSenseFilterInternal/ ReSharper_IntelliSenseFilterInternalInvert
Protected membersReSharper_IntelliSenseFilterProtected/ ReSharper_IntelliSenseFilterProtectedInvert
Private membersReSharper_IntelliSenseFilterPrivate/ ReSharper_IntelliSenseFilterPrivateInvert
Dynamic propertiesReSharper_IntelliSenseFilterDynamicProperties/ ReSharper_IntelliSenseFilterDynamicPropertiesInvert
Extension methodsReSharper_IntelliSenseFilterExtensionMethods/ ReSharper_IntelliSenseFilterExtensionMethodsInvert
KeywordsReSharper_IntelliSenseFilterKeyword/ ReSharper_IntelliSenseFilterKeywordInvert
Custom filtersReSharper_IntelliSenseFilterAggregate/ ReSharper_IntelliSenseFilterAggregateInvert

Custom filters

ReSharper allows you to define custom filters that you can use to exclude items by their assembly, namespace, and other parameters from completion suggestions.

Define a custom completion filter

  1. Select ReSharper | Options from the main menu or press Alt+R O, then choose Environment | IntelliSense | Completion Filters on the left.

  2. Make sure that the Enable Filters checkbox is ticked.

  3. Click Add on the bottom of the page and choose CLR Symbols Filter

  4. In the Custom Filter Configuration dialog that opens specify filter details:

    • Specify one or more masks for the symbol.

    • Optionally, select a kind of symbols to be matched.

    • Choose whether to match types with or without type parameters.

  5. Click OK to add the filter and close the dialog. The new filter appears in the Custom Filters area. If necessary, you can modify the filter later.

  6. Click Save in the Options dialog to apply the modifications and let ReSharper choose where to save them, or save the modifications to a specific settings layer using the Save To list. For more information, see Manage and Share ReSharper Settings.

This feature is supported in the following languages and technologies:

Language: C#Language: VB.NETLanguage: C++Language: HTMLLanguage: ASP.NETLanguage: RazorLanguage: JavaScriptLanguage: TypeScriptLanguage: CSSLanguage: XMLLanguage: XAMLLanguage: ResxLanguage: Build ScriptsLanguage: ProtobufLanguage: JSON
Feature is available in C#Feature is available in Visual Basic .NET Feature is not available in C++ Feature is not available in HTML Feature is not available in ASP.NET Feature is not available in RazorFeature is available in JavaScriptFeature is available in TypeScript Feature is not available in CSS Feature is not available in XML Feature is not available in XAML Feature is not available in Resource files Feature is not available in build script files Feature is not available in Protobuf Feature is not available in JSON

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.

Last modified: 29 April 2021