Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjustment for properties that don't match on type, or are forced as new #473

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Vetuviem.Avalonia.SourceGenerator\Vetuviem.Avalonia.SourceGenerator.csproj" OutputItemType="Analyzer" />
<ProjectReference Include="..\Vetuviem.Avalonia.SourceGenerator\Vetuviem.Avalonia.SourceGenerator.csproj" OutputItemType="Analyzer" PrivateAssets="all" ReferenceOutputAssembly="false" Private="false" />
<ProjectReference Include="..\Vetuviem.Core\Vetuviem.Core.csproj" />
</ItemGroup>

Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
string? desiredCommandInterface,
bool makeClassesPublic,
bool includeObsoleteItems,
string? platformCommandType)

Check warning on line 35 in src/Vetuviem.SourceGenerator/Features/ControlBindingModels/ControlBindingModelPropertyGenerator.cs

GitHub Actions / build

Parameter 'platformCommandType' has no matching param tag in the XML comment for 'ControlBindingModelPropertyGenerator.GetProperties(INamedTypeSymbol, string?, bool, bool, string?)' (but other parameters do)

Check warning on line 35 in src/Vetuviem.SourceGenerator/Features/ControlBindingModels/ControlBindingModelPropertyGenerator.cs

GitHub Actions / Analyze (csharp)

Parameter 'platformCommandType' has no matching param tag in the XML comment for 'ControlBindingModelPropertyGenerator.GetProperties(INamedTypeSymbol, string?, bool, bool, string?)' (but other parameters do)

Check warning on line 35 in src/Vetuviem.SourceGenerator/Features/ControlBindingModels/ControlBindingModelPropertyGenerator.cs

GitHub Actions / build

Parameter 'platformCommandType' has no matching param tag in the XML comment for 'ControlBindingModelPropertyGenerator.GetProperties(INamedTypeSymbol, string?, bool, bool, string?)' (but other parameters do)
{
if (namedTypeSymbol == null)
{
@@ -148,16 +148,22 @@
while (baseType != null)
{
var nameMatches = baseType.GetMembers()
.Where(x => x.Kind == SymbolKind.Property && x.Name.Equals(wantedName, StringComparison.Ordinal))
.Where(x => x.Kind == SymbolKind.Property && x.Name.Equals(wantedName, StringComparison.Ordinal) && x.DeclaredAccessibility == Accessibility.Public)
.Cast<IPropertySymbol>()
.ToImmutableArray();

foreach (var nameMatch in nameMatches)
if (nameMatches.Length > 0)
{
if (SymbolEqualityComparer.Default.Equals(nameMatch.Type, propertySymbol.Type))
foreach (var nameMatch in nameMatches)
{
return !propertySymbol.IsOverride;
if (SymbolEqualityComparer.Default.Equals(nameMatch.Type, propertySymbol.Type))
{
return !propertySymbol.IsOverride;
}
}

// we didn't match by type, so assume it's a new implementation on a new type.
return true;
}

baseType = baseType.BaseType;
Loading