bkoelman / ResharperCodeContractNullability

Reports diagnostics, helping you to annotate your source tree with (Item)NotNull / (Item)CanBeNull attributes.
https://www.jetbrains.com/resharper/help/Code_Analysis__Code_Annotations.html
Apache License 2.0
26 stars 4 forks source link

Support loading external annotations from NuGet package #29

Closed bkoelman closed 7 years ago

bkoelman commented 7 years ago

Allowing users to Install-Package Jetbrains.ExternalAnnotations makes it possible for users to build the source tree without having Resharper installed. This also simplifies running on build servers, which usually do not have Resharper installed.

Giving this location highest priority will also result in producing the same diagnostics for all developers, regardless of their installed version of Resharper.

To enable this, we should look for external annotations next to the .sln file that matches .\packages\JetBrains.ExternalAnnotations.*\DotFiles\ExternalAnnotations. When external annotations are found there, we should not fallback to the other locations.

How to find the .sln folder from within the running analyzer is to be investigated.

bkoelman commented 7 years ago

Complications:

bkoelman commented 7 years ago

These is currently no API available to make this possible. See https://github.com/dotnet/roslyn/issues/15977#issuecomment-268620263.