ReSharper Help

Using Filters in Code Completion

ReSharper allows you to filter completion suggestions by kind of symbol, access modifiers, etc. 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 in the bottom of the completion pou-up. In this bar, you can see the state of filters and click on the icons to enable or disable specific filters.

Filters in completion pop-up

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

In this topic:

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 check box 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 pop-up.

Filter modes

Each filter can be enabled in one of two modes: inclusive or exclusive.

Inclusive mode

if a filter is enabled in this mode, the completion list only shows items that match this filter. If there are several filters enabled in this mode, the completion list shows items that match all of these filters.

To enable filters in this mode, left-click on the filter icon, or use the corresponding shortcut.

On the filter bar, filters in this mode are highlighted with the uniform background.

Exclusive mode

if a filter is enabled in this mode, the completion list only shows items that match this filter. If there are several filters enabled in this mode, the completion list shows items that match all of these filters.

To enable filters in this mode, right-click on the filter icon, or use the corresponding shortcut.

On the filter bar, filters in this mode are highlighted with the border.

Shortcuts for completion filters

All completion filters can be toggled with dedicated keyboard shortcuts. The table below lists default shortcuts and aliases for each action. If necessary, you can use this aliases to find and override specific shortcuts in Visual Studio options. (Tools | Options | Environment | Keyboard).

FilterShortcuts (include/exclude)Action aliases (include/exclude)
NamespacesAlt+N / Alt+I,NReSharper_IntelliSenseFilterNamespaces / ReSharper_IntelliSenseFilterNamespacesInvert
ClassesAlt+C / Alt+I,CReSharper_IntelliSenseFilterClasses / ReSharper_IntelliSenseFilterClassesInvert
InterfacesAlt+T / Alt+I,TReSharper_IntelliSenseFilterInterfaces / ReSharper_IntelliSenseFilterInterfacesInvert
StructsAlt+S / Alt+I,SReSharper_IntelliSenseFilterStructs / ReSharper_IntelliSenseFilterStructsInvert
EnumsAlt+U / Alt+I,UReSharper_IntelliSenseFilterEnums / ReSharper_IntelliSenseFilterEnumsInvert
DelegatesAlt+D / Alt+I,DReSharper_IntelliSenseFilterDelegates / ReSharper_IntelliSenseFilterDelegatesInvert
EventsAlt+E / Alt+I,EReSharper_IntelliSenseFilterEvents / ReSharper_IntelliSenseFilterEventsInvert
MethodsAlt+M / Alt+I,MReSharper_IntelliSenseFilterMethods / ReSharper_IntelliSenseFilterMethodsInvert
FieldsAlt+F / Alt+I,FReSharper_IntelliSenseFilterFields / ReSharper_IntelliSenseFilterFieldsInvert
PropertiesAlt+P / Alt+I,PReSharper_IntelliSenseFilterProperties / ReSharper_IntelliSenseFilterPropertiesInvert
ParametersAlt+R / Alt+I,RReSharper_IntelliSenseFilterParameters / ReSharper_IntelliSenseFilterParametersInvert
Local VariablesAlt+L / Alt+I,LReSharper_IntelliSenseFilterLocalVariables / ReSharper_IntelliSenseFilterLocalVariablesInvert
Public membersAlt+1 / Alt+I,1ReSharper_IntelliSenseFilterPublic / ReSharper_IntelliSenseFilterPublicInvert
Internal membersAlt+2 / Alt+I,2ReSharper_IntelliSenseFilterInternal / ReSharper_IntelliSenseFilterInternalInvert
Protected membersAlt+3 / Alt+I,3ReSharper_IntelliSenseFilterProtected / ReSharper_IntelliSenseFilterProtectedInvert
Private membersAlt+4 / Alt+I,4ReSharper_IntelliSenseFilterPrivate / ReSharper_IntelliSenseFilterPrivateInvert
Dynamic propertiesAlt+5 / Alt+I,5ReSharper_IntelliSenseFilterDynamicProperties / ReSharper_IntelliSenseFilterDynamicPropertiesInvert
Extension methodsAlt+X / Alt+I,XReSharper_IntelliSenseFilterExtensionMethods / ReSharper_IntelliSenseFilterExtensionMethodsInvert
KeywordsAlt+K / Alt+I,KReSharper_IntelliSenseFilterKeyword / ReSharper_IntelliSenseFilterKeywordInvert
Custom filtersAlt+A / Alt+I,AReSharper_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.

To define a custom completion filter

  1. Open the Environment | IntelliSense | Completion Filters page of ReSharper options.
  2. Make sure that the Enable Filters check box is ticked.
  3. Click Add on the bottom of the page and choose CLR Symbols Filter
  4. In the Custom Filter Configuration dialog box 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 box. The new filter appears in the Custom Filters area. If necessary, you can modify the filter later.
  6. Click Save 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 drop-down list. For more information, see Managing and Sharing ReSharper Settings.

This feature is supported in the following languages/technologies:

C# VB.NET C++ HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available feature_available feature_available

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.

See Also

Last modified: 21 September 2015