Skip to content

Commit

Permalink
references are now updated..
Browse files Browse the repository at this point in the history
  • Loading branch information
beakona committed Jul 29, 2021
1 parent 205a163 commit 26aa737
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void Execute(GeneratorExecutionContext context)
private static List<AutoInterfaceRecord> CollectRecords(GeneratorExecutionContext context, ISymbol symbol, ITypeSymbol receiverType, INamedTypeSymbol autoInterfaceAttributeSymbol, INamedTypeSymbol autoInterfaceTemplateAttributeSymbol)
{
List<PartialTemplate> templateParts = new();
Dictionary<ISymbol, HashSet<INamedTypeSymbol>> danglingInterfaceTypesBySymbols = new();
Dictionary<ISymbol, HashSet<INamedTypeSymbol>> danglingInterfaceTypesBySymbols = new(SymbolEqualityComparer.Default);

foreach (AttributeData attribute in symbol.GetAttributes())
{
Expand Down Expand Up @@ -235,7 +235,7 @@ private static List<AutoInterfaceRecord> CollectRecords(GeneratorExecutionContex
templateParts.Add(new PartialTemplate(memberTargets, rxMemberFilter, new TemplateDefinition(templateLanguage ?? "scriban", templateBody.Trim())));
if (danglingInterfaceTypesBySymbols.TryGetValue(symbol, out HashSet<INamedTypeSymbol> interfaceTypes) == false)
{
danglingInterfaceTypesBySymbols[symbol] = interfaceTypes = new HashSet<INamedTypeSymbol>();
danglingInterfaceTypesBySymbols[symbol] = interfaceTypes = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default);
}

interfaceTypes.Add(interfaceType);
Expand Down Expand Up @@ -288,7 +288,7 @@ private static List<AutoInterfaceRecord> CollectRecords(GeneratorExecutionContex
templateParts.Add(new PartialTemplate(memberTargets, rxMemberFilter, new TemplateDefinition(templateLanguage ?? "scriban", content)));
if (danglingInterfaceTypesBySymbols.TryGetValue(symbol, out HashSet<INamedTypeSymbol> interfaceTypes) == false)
{
danglingInterfaceTypesBySymbols[symbol] = interfaceTypes = new HashSet<INamedTypeSymbol>();
danglingInterfaceTypesBySymbols[symbol] = interfaceTypes = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default);
}

interfaceTypes.Add(interfaceType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.8.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.8.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Scriban" Version="3.5.0" PrivateAssets="all" IncludeAssets="Build" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.10.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.10.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" PrivateAssets="all" />
<PackageReference Include="Scriban" Version="4.0.1" PrivateAssets="all" IncludeAssets="build" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions BeaKona.AutoInterfaceGenerator/ScopeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public ScopeInfo(ScopeInfo parentScope)
public ITypeSymbol Type { get; }

private readonly HashSet<string> usedTypeArguments;
private readonly Dictionary<ITypeSymbol, string> aliasTypeParameterNameByCanonicalType = new Dictionary<ITypeSymbol, string>(SymbolEqualityComparer.Default);
private readonly Dictionary<ITypeSymbol, string> aliasTypeParameterNameByCanonicalType = new(SymbolEqualityComparer.Default);

private static ImmutableList<ITypeSymbol> AllTypeArguments(ISymbol symbol)
{
List<ITypeSymbol> types = new List<ITypeSymbol>();
List<ITypeSymbol> types = new();

for (ISymbol s = symbol; s != null; s = s.ContainingType)
{
Expand Down Expand Up @@ -78,7 +78,7 @@ public bool TryGetAlias(ITypeSymbol symbol, /*[NotNullWhen(true)]*/ out string?
return this.aliasTypeParameterNameByCanonicalType.TryGetValue(symbol, out alias);
}

private static readonly Regex rxSplitter = new Regex(@"^\s*(?<n>\w+)(?<value>\d+)\s*$", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.CultureInvariant);
private static readonly Regex rxSplitter = new(@"^\s*(?<n>\w+)(?<value>\d+)\s*$", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.CultureInvariant);

private static bool TrySplitAsBaseNameAndInteger(string name, /*[NotNullWhen(true)]*/ out string? baseName, /*[NotNullWhen(true)]*/ out int? value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.8.0-5.final" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 26aa737

Please sign in to comment.