Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 744 Bytes

File metadata and controls

27 lines (21 loc) · 744 Bytes

Readable bitwise operations (Rider plugin)

Download from JetBrains plugins repository.

Folds simple bitwise operations on enums with [Flags] into simpler green text that looks like this:

For example, it turns

if ( (options & ReflectionNameOptions.XmlDocPrefix) != 0 )

into

if ( ReflectionNameOptions.XmlDocPrefix ∈ options )

and it turns

if ( (options & ReflectionNameOptions.XmlDocPrefix) == 0 )

into

if ( ReflectionNameOptions.XmlDocPrefix ∉ options )

This helps you avoid errors and you don't need to think as long about what != or == actually means. It works on any enum with [Flags].