Closed dsaf closed 7 years ago
Currently JetBrains' annotations are already treated specially, these are the only attributes that are displayed inside the tooltips (if the "display annotations for identifiers" option is set to "display all")).
There's only the attribute name though, not full information, so I'm keeping this open.
Yes, I turned that on. The presentation could be similar to that of possible exception (little gray box [Contract] and the arrow notation).
Consider standard string.IsNullOrWhiteSpace(...) method. On mouse over it will say "(method) [ContractAnnotation, Pure] ..." Yet I don't know what that ContractAnnotation states and it could be anything. Furthermore because it is annotated externally even navigating to sources will not give me the information!
Indeed. Quick doc displays full external annotations, but I understand that you don't like it :)
I am afraid so. For example on my custom non-documented annotated method FormatWith I need to:
1) press Ctrl+Shift+F1 2) click on the attribute link to expand it
Also when I press "go to read more" it tries to find my absent documentation on MSDN. And last but not least: it's not colorful at all :).
Thanks!
You're welcome! Please try it in v3.0.1 for ReSharper 2017.1 EAP4.
Looks like it works just fine in VS 2015:
Will try in VS 2017 soon as well.
http://blog.jetbrains.com/dotnet/2012/08/15/contract-annotations-in-resharper-7
https://github.com/aspnet/EntityFramework/blob/dev/src/Shared/Check.cs
Code example:
When hovering over the FormatWith usage it would be nice to show something like:
"(method) [ContractAnnotation("format: null => halt")] [StringFormatMethod("format")] [Pure] ...signature... "
Alternatively / additionally, treat JetBrain contracts specially:
"(method) [StringFormatMethod("format")] ...signature... pure format: null => halt"