Skip to content

Fluent Library for generating ReSharper External annotation files.

License

Notifications You must be signed in to change notification settings

vbfox/ExternalAnnotationsGenerator

Repository files navigation

ReSharper external annotations generator Library

Join the chat in Gitter Build status MIT License Nuget Package

Fluent Library for generating JetBrain's ReSharper External annotation files.

Syntax

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.

Thanks

This project started as a fork of ReSharper.ExternalAnnotations.Generator by @chillitom and might not have existed without it.

About

Fluent Library for generating ReSharper External annotation files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published