Request for feature: Show [NotNull] and [CanBeNull] annotations in intellisense-box

A "minor" feature that I miss a lot in ReSharper, also in the latest version 7, is to have [NotNull] and [CanBeNull] annotations shown in the ReSharper intellisense-box. I see this is done in the intellisense-box as of IntelliJ IDEA and I think users of ReSharper could benefit from the same feature. Any plans to implement this in ReSharper?

5 comments
Comment actions Permalink

Thanks for pointing me to the Agent Johnson plugin, but I can not see how that plugin can help me with seeing if arguments are annotated with [NotNull]/[CanBeNull] directly in the intellisense-box?

0
Comment actions Permalink

As far as i know it has the following features:

  • It will warn you about every reference parameter of a method/property not attributed with [NotNull]/[CanBeNull]. In doing that it will correctly process implemented interfaces and base classes.
  • It provides context actions on method parameters/properties for adding the attributes (Isn't that what you meant with the intellisense-box?).
  • It will not warn when the code flow dereferences a [NotNull] value (Resharper alone would normally do).
  • It will automatically add an [CanBeNull] attribute to a method parameter when you do the check if null context action on it.


See also: http://code.google.com/p/agentjohnsonplugin/wiki/ConfigureValueAnalysis

0
Comment actions Permalink

I see, and those features are nice for a plugin. But what I miss is a way to visually see in the intellisense-box (Ctrl+Space) if a method and/or its parameters are annotatet with one of those [NotNull]/[CanBeNull] attributes. As far as I can see, this is not part of the features of that Agent Johnson plugin.

0
Comment actions Permalink

Ah i see,

Probably plugins can't extend the intellisense box content. Resharper would have to do it natively.

I am using NotNull and CanBeNull in a current project and it turned out to be useful for documenting interfaces and catching possible null reference errors. So i would also support a feature request for value analysis handling directly in Resharper.

0

Please sign in to leave a comment.