Back to Devexpress

Context Providers

coderushforroslyn-117845-coding-assistance-custom-template-creation-context-providers.md

latest1.5 KB
Original Source

Context Providers

  • Apr 13, 2022

Contexts are widely used in CodeRush for distinguishing states. The Context can be specified in the following CodeRush features.

  • Templates — you can setup a template to expand only in certain conditions.
  • Shortcuts — you can setup a command to execute only in certain conditions.

The Context is defined with one or several Context Providers combined in a complex expression with the following operators (ordered by priority).

PriorityOperatorDescriptionExample
1( )Grouping brackets([InClass]
2!Logical NOT![OnEmptyLine]
3&&Logical AND[InCodeBlock] && [OnEmptyLine]
4****

The Context Providers are separated by the following groups. Refer to the corresponding topic to learn about the Context Providers which belong to the group.