How to: Search for Code Symbols of a Certain Kind

  • 2 minutes to read

This example shows how to change the Ctrl+Shift+Q shortcut to open the Jump to Symbol window with a custom filter. This filter allows you to find code symbols of a specific kind (for example, methods, properties, etc). You can also use other parameters for this filter (for example, access modifier and scope). CodeRush applies the filter when you type a symbol's name or a part of it in the search field of the Jump to Symbol window.

You can also create custom shortcuts that open the Jump to Symbol window with different filters.

Follow the steps below.

  • Use the CodeRush | Shortcuts... menu item to access the shortcuts configuration options page.

    Config_Shortcuts_Access

  • Create a new shortcut with the JumpToSymbol command or find Ctrl + Shift + Q.

    Config_Shortcuts

  • Specify the initial filter in "Parameters".

    The JumpToSymbol command accepts four parameters:

    • TypeFilter

      Possible values: Classes, Interfaces, Structs, Enums, Delegates, and AllTypes. Accepts values separated by and.

    • MemberFilter

      Possible values: Methods, Properties, Events, Fields, LocalsAndParams, and AllMembers. Accepts values separated by and.

    • AccessFilter

      Possible values: Private, Protected, Internal, ProtectedInternal, Public, and AllVisibilities. Accepts values separated by and.

    • LocationFilter

      Possible values: Solution, Project, Namespace, and File. Accepts a single value.

      IMPORTANT

      Use the parameter order listed above.

    The screenshot below shows the Ctrl + Shift + Q shortcut with the Classes,Methods and Properties,Public,Project filter.

    Filter

  • Click OK to save changes and close the Shortcuts window.

  • Press Ctrl+Shift+Q or your custom shortcut to open the Jump to Symbol window.

    Window

  • Type a symbol's name or a part of it in the search field. Tab Ctrl to see this filter in the invoked window.

    Filter

See Also