Fluent Library for generating JetBrain's ReSharper External annotation files.
The syntax used to create an annotation is a fluent syntax like :
var annotator = Annotator.Create();
annotator.Annotate<ILogger>(type =>
{
type.Annotate(logger => logger.Debug(NotNull<Exception>(), FormatString(), Some<object[]>()));
});
annotator.Annotate<ILoggerFactory>(type =>
{
type.Annotate(logger => logger.GetLogger(NotNull<Type>()) == NotNull<ILogger>());
});
The annotations that can be found in AnnotationGenerator.Annotations
are :
Some<T>
: Used as a marker for a parameter without any special attribute.NotNull<T>
: Adds[NotNullAttribute]
to either a parameter, member or method result.CanBeNull<T>
: Adds[CanBeNullAttribute]
to either a parameter, member or method result.FormatString
: Adds[StringFormatMethodAttribute]
to the method with the corresponding parameter name and[NotNullAttribute]
to the parameter.NullableFormatString
: Adds[StringFormatMethodAttribute]
to the method with the corresponding parameter name and[CanBeNullAttribute]
to the parameter.
This project started as a fork of ReSharper.ExternalAnnotations.Generator by @chillitom and might not have existed without it.