forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ChangeSignatureTelemetry
- Loading branch information
Showing
420 changed files
with
9,161 additions
and
6,319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
docs/compilers/Design/Notes/10-29-19.md → docs/compilers/API Notes/10-29-19.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## API Review Notes for April 15th, 2020 | ||
|
||
### Changes reviewed | ||
Starting commit: `c827247a767c0c434dcb77496038b163b9e011da` | ||
|
||
Ending Commit: `3375a7b209d1f590940af043e9e39f2cbb503845` | ||
|
||
### Notes | ||
|
||
#### Everything but Source Generators: | ||
|
||
* `Project.RemoveDocuments`: Everything else in this type uses `IEnumerable<T>`, not `ImmutableArray<T>`. If we could start again from day 1 we might make everything that, but given that everything today uses the former, we should do so here. This applies to the overloads on `Solution` as well. | ||
* `Solution.RemoveAdditonalDocuments/RemoveAnalyzerConfigDocuments`: We added these to `Solution`, but not to project, even though that also has the invididual `Remove` methods. We should add them to `Project` as well. | ||
* `DocumentOptionSet.GetOption`: This API was added as a `new` on the concrete `DocumentOptionSet` to cover a change when we moved the implementation up to `OptionSet` and made the method non-virtual. This is not actually a breaking change, so we should remove this. | ||
|
||
#### Source Generators: | ||
|
||
As a general note, changes that we make here are _not_ considered breaking changes post 16.6. | ||
However, we did take a broad overview of the API surface and have some notes for @chsienki. | ||
|
||
* `GeneratorAttribute`: we should consider adding a `LanguageName` attribute to this type. | ||
* `InitializationContext`: Rename to something like `SourceGeneratorInitialzationContext` or similar. Current name is ambiguous. | ||
* `InitializationContext.RegisterForNotifications`: | ||
* Naming is inconsistent with existing `Action` ending for analyzer register methods. | ||
* `SyntaxReceiverCreator`: all other `RegisterForXAction` methods in analyzers use an `Action` or `Func`, as appropriate. We should consider doing the same here. | ||
* `ISyntaxReceiver`: This may be redundant with existing APIs. | ||
* `SourceGeneratorContext`: There is not currently a way to share semantic models and other binding info between source generators. We should design a way for this info to be shared so we can avoid introducing lots of binding from generators. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,255 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> | ||
<Project> | ||
<!-- | ||
This file must be imported after targets from NuGet packages have been imported (e.g. from Directory.Build.targets). | ||
It overwrites GeneratePkgDef defined by VSSDK NuGet package targets. | ||
GeneratePkgDef target defined below generates .pkgdef file based on PkgDef* items that represent entries in pkgdef file. | ||
Unlike the VSSDK implementation it does not load the project assembly and does not use RegistrationAttributes. | ||
The following item PkgDef* groups are recognized: | ||
1) PkgDefPackageRegistration | ||
Corresponds to Microsoft.VisualStudio.Shell.PackageRegistrationAttribute. | ||
Project specifies this entry explicitly. | ||
Metadata: | ||
- ItemSpec: package guid | ||
- Name: package name | ||
- Class: namespace qualified type name of package implementation class | ||
- AllowsBackgroundLoad: bool | ||
2) PkgDefInstalledProduct | ||
Emits $RootKey$\InstalledProducts entry. | ||
Project specifies this entry explicitly. | ||
Metadata: | ||
- ItemSpec: package guid | ||
- Name | ||
- DisplayName (resource id) | ||
- ProductDetauls (resource id) | ||
3) PkgDefBindingRedirect | ||
Emits $RootKey$\RuntimeConfiguration\dependentAssembly\bindingRedirection entry. | ||
Project may specify <PkgDefEntry>BindingRedirect</PkgDefEntry> on any item that contributes to ReferencePath item group. | ||
(e.g. ProjectReference), or on NuGetPackageToIncludeInVsix items. These items will be automatically included in PkgDefEntry items. | ||
Metadata: | ||
- ItemSpec: full path to the binary if FusionName is not specified, otherwise it may be just a file name | ||
- FusionName: optional assembly name (read from the binary if not specified) | ||
4) PkgDefCodeBase | ||
Emits $RootKey$\RuntimeConfiguration\dependentAssembly\codeBase entry. | ||
Project may specify <PkgDefEntry>CodeBase</PkgDefEntry> on any item that contributes to ReferencePath item group. | ||
(e.g. ProjectReference), or on NuGetPackageToIncludeInVsix items. These items will be automatically included in PkgDefEntry items. | ||
Metadata: | ||
- ItemSpec: full path to the binary | ||
- FusionName: optional assembly name (read from the binary if not specified) | ||
5) PkgDefFileContent | ||
Merges the content of the file whose path is specified in the identity of the item to the generated pkgdef file. | ||
The path may be relative to the project being built. | ||
Project may specify these items using None item group with PkgDefEntry="FileContent" metadata set like so: | ||
<None Include="PackageRegistration.pkgdef" PkgDefEntry="FileContent"/>. | ||
PkgDefFileContent allows the project to add arbitrary static content. The other kinds are used to generate dynamic content. | ||
Note: We use None items since we do not want them to be included in VSIX and we want them to be displayed in Solution Explorer | ||
(if we used Content items they would get included in the VSIX by VSSDK by default). | ||
--> | ||
|
||
<UsingTask TaskName="Microsoft.DotNet.Build.Tasks.VisualStudio.GetPkgDefAssemblyDependencyGuid" AssemblyFile="$(ArcadeVisualStudioBuildTasksAssembly)" /> | ||
<UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.GetAssemblyFullName" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" /> | ||
|
||
<Target Name="_SetGeneratePkgDefInputsOutputs"> | ||
<PropertyGroup> | ||
<!-- The path must match the value that VSSDK uses. --> | ||
<_GeneratePkgDefOutputFile>$(IntermediateOutputPath)$(TargetName).pkgdef</_GeneratePkgDefOutputFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<_FileContentEntries Include="@(None)" Condition="'%(None.PkgDefEntry)' == 'FileContent'"> | ||
<FullFilePath>$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '%(None.Identity)'))</FullFilePath> | ||
</_FileContentEntries> | ||
|
||
<PkgDefFileContent Include="@(_FileContentEntries->'%(FullFilePath)')" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- | ||
Initializes metadata of PkgDefPackageRegistration items. | ||
--> | ||
<Target Name="_InitializePackageRegistrationEntries" | ||
BeforeTargets="GeneratePkgDef" | ||
DependsOnTargets="GetAssemblyVersion"> | ||
<PropertyGroup> | ||
<_AssemblyCodeBase>$([System.IO.Path]::Combine('$PackageFolder$', '$(AssemblyVSIXSubPath)', '$(TargetFileName)'))</_AssemblyCodeBase> | ||
<_AssemblyOrCodeBase Condition="'$(UseCodeBase)' != 'true'">"Assembly"="$(AssemblyName), Version=$(AssemblyVersion), Culture=neutral, PublicKeyToken=$(PublicKeyToken)"</_AssemblyOrCodeBase> | ||
<_AssemblyOrCodeBase Condition="'$(UseCodeBase)' == 'true'">"CodeBase"="$(_AssemblyCodeBase)"</_AssemblyOrCodeBase> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PkgDefPackageRegistration Update="@(PkgDefPackageRegistration)"> | ||
<_AllowsBackgroundLoad>dword:00000000</_AllowsBackgroundLoad> | ||
<_AllowsBackgroundLoad Condition="'%(PkgDefPackageRegistration.AllowsBackgroundLoad)' == 'true'">dword:00000001</_AllowsBackgroundLoad> | ||
<_AssemblyOrCodeBase>$(_AssemblyOrCodeBase)</_AssemblyOrCodeBase> | ||
</PkgDefPackageRegistration> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- | ||
Initializes metadata of PkgDefInstalledProduct items. | ||
--> | ||
<Target Name="_InitializeInstalledProductEntries" | ||
BeforeTargets="GeneratePkgDef" | ||
DependsOnTargets="AddSourceRevisionToInformationalVersion"> | ||
<ItemGroup> | ||
<PkgDefInstalledProduct Update="@(PkgDefInstalledProduct)"> | ||
<_PID>$(InformationalVersion)</_PID> | ||
</PkgDefInstalledProduct> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- | ||
Populates PkgDefBindingRedirect and PkgDefCodeBase items from references. | ||
--> | ||
<Target Name="_AddPkgDefEntriesFromReferences" | ||
BeforeTargets="AfterResolveReferences;GeneratePkgDef"> | ||
<ItemGroup> | ||
<PkgDefBindingRedirect Include="@(ReferencePath)" Condition="'%(ReferencePath.PkgDefEntry)' == 'BindingRedirect'" /> | ||
<PkgDefCodeBase Include="@(ReferencePath)" Condition="'%(ReferencePath.PkgDefEntry)' == 'CodeBase'" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- | ||
Generates a .pkgdef file based on items in PkgDef* groups. | ||
--> | ||
<Target Name="GeneratePkgDef" | ||
DependsOnTargets="$(GeneratePkgDefDependsOn);_SetGeneratePkgDefInputsOutputs" | ||
Inputs="$(MSBuildAllProjects)" | ||
Outputs="$(_GeneratePkgDefOutputFile)"> | ||
<ItemGroup> | ||
<_AssemblyDependencyEntry Include="@(PkgDefBindingRedirect)" Kind="BindingRedirect" /> | ||
<_AssemblyDependencyEntry Include="@(PkgDefCodeBase)" Kind="CodeBase" /> | ||
|
||
<_AssemblyDependencyEntryWithoutAssemblyName Include="@(_AssemblyDependencyEntry)" Condition="'%(_AssemblyDependencyEntry.FusionName)' == ''" /> | ||
<_AssemblyDependencyEntry Remove="@(_AssemblyDependencyEntryWithoutAssemblyName)" /> | ||
</ItemGroup> | ||
|
||
<Microsoft.DotNet.Arcade.Sdk.GetAssemblyFullName Items="@(_AssemblyDependencyEntryWithoutAssemblyName)" FullNameMetadata="FusionName"> | ||
<Output TaskParameter="ItemsWithFullName" ItemName="_AssemblyDependencyEntryWithCalculatedAssemblyName"/> | ||
</Microsoft.DotNet.Arcade.Sdk.GetAssemblyFullName> | ||
|
||
<ItemGroup> | ||
<_AssemblyDependencyEntry Include="@(_AssemblyDependencyEntryWithCalculatedAssemblyName)" /> | ||
|
||
<_AssemblyDependencyEntry Update="@(_AssemblyDependencyEntry)"> | ||
<AssemblyFileName>%(_AssemblyDependencyEntry.FileName)%(_AssemblyDependencyEntry.Extension)</AssemblyFileName> | ||
<OldAssemblyVersion>0.0.0.0</OldAssemblyVersion> | ||
|
||
<!-- Split FusionName: "{0}, Version={1}, Culture={2}, PublicKeyToken={3}" --> | ||
<AssemblyName>$([MSBuild]::ValueOrDefault('%(_AssemblyDependencyEntry.FusionName)', '').Split(',')[0])</AssemblyName> | ||
<AssemblyVersion>$([MSBuild]::ValueOrDefault('%(_AssemblyDependencyEntry.FusionName)', '').Split(',')[1].Split('=')[1])</AssemblyVersion> | ||
<Culture>$([MSBuild]::ValueOrDefault('%(_AssemblyDependencyEntry.FusionName)', '').Split(',')[2].Split('=')[1])</Culture> | ||
<PublicKeyToken>$([MSBuild]::ValueOrDefault('%(_AssemblyDependencyEntry.FusionName)', '').Split(',')[3].Split('=')[1])</PublicKeyToken> | ||
</_AssemblyDependencyEntry> | ||
|
||
<_AssemblyDependencyEntry Update="@(_AssemblyDependencyEntry)" Condition="'%(Kind)' == 'BindingRedirect'"> | ||
<HashBase>%(AssemblyName),%(PublicKeyToken),%(Culture),%(OldAssemblyVersion)-%(AssemblyVersion),%(AssemblyVersion)</HashBase> | ||
</_AssemblyDependencyEntry> | ||
|
||
<_AssemblyDependencyEntry Update="@(_AssemblyDependencyEntry)" Condition="'%(Kind)' == 'CodeBase'"> | ||
<HashBase>%(AssemblyName),%(PublicKeyToken),%(Culture),%(AssemblyVersion)</HashBase> | ||
</_AssemblyDependencyEntry> | ||
</ItemGroup> | ||
|
||
<Microsoft.DotNet.Build.Tasks.VisualStudio.GetPkgDefAssemblyDependencyGuid Items="@(_AssemblyDependencyEntry)" InputMetadata="HashBase" OutputMetadata="Guid"> | ||
<Output TaskParameter="OutputItems" ItemName="_AssemblyDependencyEntryWithGuid"/> | ||
</Microsoft.DotNet.Build.Tasks.VisualStudio.GetPkgDefAssemblyDependencyGuid> | ||
|
||
<ItemGroup> | ||
<_AssemblyDependencyEntry Remove="@(_AssemblyDependencyEntry)" /> | ||
<_AssemblyDependencyEntry Include="@(_AssemblyDependencyEntryWithGuid)" /> | ||
|
||
<_PkgDefEntry Include="@(PkgDefPackageRegistration)"> | ||
<RawValue> | ||
<![CDATA[[$RootKey$\Packages\%(PkgDefPackageRegistration.Identity)] | ||
@="%(PkgDefPackageRegistration.Name)" | ||
"InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" | ||
"Class"="%(PkgDefPackageRegistration.Class)" | ||
%(PkgDefPackageRegistration._AssemblyOrCodeBase) | ||
"AllowsBackgroundLoad"=%(PkgDefPackageRegistration._AllowsBackgroundLoad) | ||
]]> | ||
</RawValue> | ||
</_PkgDefEntry> | ||
|
||
<_PkgDefEntry Include="@(PkgDefInstalledProduct)"> | ||
<RawValue> | ||
<![CDATA[[$RootKey$\InstalledProducts\%(PkgDefInstalledProduct.Name)] | ||
@="%(PkgDefInstalledProduct.DisplayName)" | ||
"Package"="%(PkgDefInstalledProduct.Identity)" | ||
"PID"="%(PkgDefInstalledProduct._PID)" | ||
"ProductDetails"="%(PkgDefInstalledProduct.ProductDetails)" | ||
"UseInterface"=dword:00000000 | ||
"UseVSProductID"=dword:00000000 | ||
]]> | ||
</RawValue> | ||
</_PkgDefEntry> | ||
|
||
<_PkgDefEntry Include="@(_AssemblyDependencyEntry)" Condition="'%(_AssemblyDependencyEntry.Kind)' == 'BindingRedirect'"> | ||
<RawValue> | ||
<![CDATA[[$RootKey$\RuntimeConfiguration\dependentAssembly\bindingRedirection\%(_AssemblyDependencyEntry.Guid)] | ||
"name"="%(_AssemblyDependencyEntry.AssemblyName)" | ||
"publicKeyToken"="%(_AssemblyDependencyEntry.PublicKeyToken)" | ||
"culture"="%(_AssemblyDependencyEntry.Culture)" | ||
"oldVersion"="%(_AssemblyDependencyEntry.OldAssemblyVersion)-%(_AssemblyDependencyEntry.AssemblyVersion)" | ||
"newVersion"="%(_AssemblyDependencyEntry.AssemblyVersion)" | ||
"codeBase"="$PackageFolder$\%(_AssemblyDependencyEntry.AssemblyFileName)" | ||
]]> | ||
</RawValue> | ||
</_PkgDefEntry> | ||
|
||
<_PkgDefEntry Include="@(_AssemblyDependencyEntry)" Condition="'%(_AssemblyDependencyEntry.Kind)' == 'CodeBase'"> | ||
<RawValue> | ||
<![CDATA[[$RootKey$\RuntimeConfiguration\dependentAssembly\codeBase\%(_AssemblyDependencyEntry.Guid)] | ||
"name"="%(_AssemblyDependencyEntry.AssemblyName)" | ||
"publicKeyToken"="%(_AssemblyDependencyEntry.PublicKeyToken)" | ||
"culture"="%(_AssemblyDependencyEntry.Culture)" | ||
"version"="%(_AssemblyDependencyEntry.AssemblyVersion)" | ||
"codeBase"="$PackageFolder$\%(_AssemblyDependencyEntry.AssemblyFileName)" | ||
]]> | ||
</RawValue> | ||
</_PkgDefEntry> | ||
</ItemGroup> | ||
|
||
<!-- Include content generated above --> | ||
<ItemGroup> | ||
<_PkgDefLines Include="@(_PkgDefEntry->'%(RawValue)')" /> | ||
</ItemGroup> | ||
|
||
<!-- Include content of files listed in PkgDefFileContent items --> | ||
<ItemGroup> | ||
<_FilesToMerge Include="@(PkgDefFileContent)"/> | ||
</ItemGroup> | ||
|
||
<ReadLinesFromFile File="%(_FilesToMerge.Identity)" Condition="'@(_FilesToMerge)' != ''"> | ||
<Output TaskParameter="Lines" ItemName="_PkgDefLines"/> | ||
</ReadLinesFromFile> | ||
|
||
<Error Text="GeneratePkgDefFile is true but the project did not produce any entries (PkgDef* items) to be written to pkgdef file" | ||
Condition="'@(_PkgDefLines)' == ''"/> | ||
|
||
<!-- Write final pkgdef content. If the CTO file was changed, touch the pkgdef file to cause a re-merge (see VSSDK targets). --> | ||
<WriteLinesToFile File="$(_GeneratePkgDefOutputFile)" | ||
Lines="@(_PkgDefLines)" | ||
Overwrite="true" | ||
Encoding="UTF-8" | ||
WriteOnlyWhenDifferent="!$([MSBuild]::ValueOrDefault('$(CTOFileHasChanged)', 'false'))" /> | ||
<ItemGroup> | ||
<FileWrites Include="$(_GeneratePkgDefOutputFile)" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
Oops, something went wrong.