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

Commit

Permalink
fix: Actually clear resolved names (#42)
Browse files Browse the repository at this point in the history
* fix: Actually clear resolved names
* nit: White space
  • Loading branch information
worldbeater authored Mar 1, 2021
1 parent fbcc40f commit 9daf718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Avalonia.NameGenerator/Generator/XamlXNameResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public XamlXNameResolver(string defaultFieldModifier = "internal")

public IReadOnlyList<ResolvedName> ResolveNames(XamlDocument xaml)
{
_items.Clear();
xaml.Root.Visit(this);
xaml.Root.VisitChildren(this);
return _items;
Expand Down
5 changes: 2 additions & 3 deletions src/Avalonia.NameGenerator/Generator/XamlXViewResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ IXamlAstNode IXamlAstVisitor.Visit(IXamlAstNode node)
var split = text.Text.Split('.');
var nameSpace = string.Join(".", split.Take(split.Length - 1));
var className = split.Last();



_resolvedClass = new ResolvedView(className, clrType, nameSpace, _xaml);
return node;
}
Expand All @@ -93,4 +92,4 @@ void IXamlAstVisitor.Push(IXamlAstNode node) { }

void IXamlAstVisitor.Pop() { }
}
}
}

0 comments on commit 9daf718

Please sign in to comment.