Skip to content

Commit

Permalink
Remove DisableFrameworkReferenceAnalyzers
Browse files Browse the repository at this point in the history
This property was a somewhat arbitrary hack off of all framework source generators / analyzers.

If we do something like this, it would make more sense to have it be more targeted.  https://github.com/dotnet/sdk/issues/19501
  • Loading branch information
ericstj authored Aug 4, 2021
1 parent 6633754 commit 3f1c7aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accepted/2021/InboxSourceGenerators.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Source generators and analyzers are represented and communicated in the same man

To facilitate this, we will package source generators inside [reference packs](https://github.com/dotnet/designs/blob/main/accepted/2019/targeting-packs-and-runtime-packs.md). We will use the standard [NuGet conventions for describing analyzers](https://docs.microsoft.com/en-us/nuget/guides/analyzers-conventions) with respect to the location in the package, however the SDK will not probe this path. All source generators and their metadata will be listed in FrameworkList.xml, similar to references. Analyzers will be added as `File` elements with `Type="Analyzer"` (constrasting to `Type="Managed"` which is currently used for references) and optionally `Language="cs|vb|..."` (where languages match those honored by nuget conventions). Omitting the `Language` attribute means the analyzer applies to all languages. The .NET SDK will be responsible for locating the appropriate source generators from the refpack, based on the project's `$(Language)` and creating `@(Analyzer)` items as part of the `ResolveTargetingPackAssets` task. These items will be conflict-resolved with other `@(Analyzer)` sources as described in the following section. When viewed from the IDE it should be clear that the source of the `Analyzer` is the framework reference, similarly to how it is clear that the source of NuGet package analyzers come from packaages.

Existing public functionality which controls the behavior of shared-framework references should also apply to source generators. `$(DisableImplicitFrameworkReferences)` should disable the creation of `@(Analyzer)` items. Any other property which might disable the creation of `@(Reference)` items from the ref-pack should also disable the creation of `@(Analyzer)` items. Additionally, a new property should be introduced to disable the creation of `@(Analyzer)` items: `$(DisableFrameworkReferenceAnalyzers)`. No mechanism will be provided to select individual `@(Analyzer)` items, just as there is no mechanism to select individual `@(Reference)` items.
Existing public functionality which controls the behavior of shared-framework references should also apply to source generators. `$(DisableImplicitFrameworkReferences)` should disable the creation of `@(Analyzer)` items. Any other property which might disable the creation of `@(Reference)` items from the ref-pack should also disable the creation of `@(Analyzer)` items.

Alternative designs are listed in the [Q & A](#Q%20&%20A) section below.

Expand Down

0 comments on commit 3f1c7aa

Please sign in to comment.