Conditional Invocations - prodot/ReCommended-Extension GitHub Wiki
The purpose is to give a visual impression that the code is not called under any condition.
Currently, the ReSharper highlights the Debug.Assert invocations if the current build settings are RELEASE. However, for DEBUG builds there are no special "highlighting mode".
What should be highlighted:
- Method invocations if the method has the
[Conditional]annotation. e.g.Debug.Assert(...). - Attribute usages if the attribute class has the
[Conditional]annotation, e.g.[SuppressMessage].
Note
Conditional methods become always highlighted, e.g.
-
if the current configuration is RELEASE:
- the
Debug.Assertstatements are highlighted by ReSharper with the message "Method invocation is skipped. Compiler will not generate method invocation because the method is conditional...".
- the
-
if the current configuration is DEBUG:
- the
Debug.Assertstatements are highlighted by this extension with the message "Method invocation will be skipped if the 'DEBUG' condition is not defined."
- the
Note
The analyzer can be configured or deactivated in the ReSharper Options or Rider Settings dialog.