Skip to content
This repository was archived by the owner on Jun 28, 2023. It is now read-only.

Commit 9daf718

Browse files
authored
fix: Actually clear resolved names (#42)
* fix: Actually clear resolved names * nit: White space
1 parent fbcc40f commit 9daf718

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Avalonia.NameGenerator/Generator/XamlXNameResolver.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public XamlXNameResolver(string defaultFieldModifier = "internal")
1818

1919
public IReadOnlyList<ResolvedName> ResolveNames(XamlDocument xaml)
2020
{
21+
_items.Clear();
2122
xaml.Root.Visit(this);
2223
xaml.Root.VisitChildren(this);
2324
return _items;

src/Avalonia.NameGenerator/Generator/XamlXViewResolver.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ IXamlAstNode IXamlAstVisitor.Visit(IXamlAstNode node)
7979
var split = text.Text.Split('.');
8080
var nameSpace = string.Join(".", split.Take(split.Length - 1));
8181
var className = split.Last();
82-
83-
82+
8483
_resolvedClass = new ResolvedView(className, clrType, nameSpace, _xaml);
8584
return node;
8685
}
@@ -93,4 +92,4 @@ void IXamlAstVisitor.Push(IXamlAstNode node) { }
9392

9493
void IXamlAstVisitor.Pop() { }
9594
}
96-
}
95+
}

0 commit comments

Comments
 (0)