Skip to content

Commit

Permalink
Merge branch 'master' into ChangeSignatureTelemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
David Poeschl authored Apr 23, 2020
2 parents 1644a85 + 894fce6 commit 42b4998
Show file tree
Hide file tree
Showing 420 changed files with 9,161 additions and 6,319 deletions.
1 change: 1 addition & 0 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ efforts behind them.
| [Covariant](https://github.com/dotnet/csharplang/issues/49) [Returns](https://github.com/dotnet/csharplang/issues/2844) | [features/covariant-returns](https://github.com/dotnet/roslyn/tree/features/covariant-returns) | [In Progress](https://github.com/dotnet/roslyn/issues/43188) | [gafter](https://github.com/gafter) | TBD,TBD | [gafter](https://github.com/gafter) |
| [Extension GetEnumerator](https://github.com/dotnet/csharplang/issues/3194) | [features/extension-foreach](https://github.com/dotnet/roslyn/tree/features/extension-foreach) | [In Progress](https://github.com/dotnet/roslyn/issues/43184) | [YairHalberstadt](https://github.com/YairHalberstadt) | [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |
| [Module initializers](https://github.com/RikkiGibson/csharplang/blob/module-initializers/proposals/module-initializers.md) | TBD | [In progress / design](https://github.com/dotnet/roslyn/issues/40500) | [RikkiGibson](https://github.com/RikkiGibson) [jnm2](https://github.com/jnm2)| [AlekseyTs](https://github.com/AlekseyTs) | [gafter](https://github.com/gafter) |
| [Extending Partial](https://github.com/jaredpar/csharplang/blob/partial/proposals/extending-partial-methods.md) | [features/partial-methods](https://github.com/dotnet/roslyn/tree/features/partial-methods) | In-Progress | [RikkiGibson](https://github.com/RikkiGibson) | [chsienki](https://github.com/chsienki) | [jaredpar](https://github.com/jaredpar) |


# C# 8.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## API Review Notes for September 30th, 2019

### Changes reviewed
Starting commit: `38c90f8401f9e3ee5fb7c82aac36f6b85fdda979`

Ending Commit: `b8a5611e3db4f7ac3b5e1404b129304b5baf843e`

### Notes

IVariableDeclarationOperation:
- What does scripting do for using local declarations in IOperation?

Expand Down
27 changes: 27 additions & 0 deletions docs/compilers/API Notes/4-15-20.md
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.
21 changes: 0 additions & 21 deletions docs/compilers/Design/Notes/9-30-19.md

This file was deleted.

255 changes: 255 additions & 0 deletions eng/targets/GeneratePkgDef.targets
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>
Loading

0 comments on commit 42b4998

Please sign in to comment.