Browse Source
fix: Actually clear resolved names (#42)
* fix: Actually clear resolved names
* nit: White space
pull/10407/head
1.0.4
Artyom V. Gorchakov
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
3 deletions
-
src/Avalonia.NameGenerator/Generator/XamlXNameResolver.cs
-
src/Avalonia.NameGenerator/Generator/XamlXViewResolver.cs
|
|
|
@ -18,6 +18,7 @@ namespace Avalonia.NameGenerator.Generator |
|
|
|
|
|
|
|
public IReadOnlyList<ResolvedName> ResolveNames(XamlDocument xaml) |
|
|
|
{ |
|
|
|
_items.Clear(); |
|
|
|
xaml.Root.Visit(this); |
|
|
|
xaml.Root.VisitChildren(this); |
|
|
|
return _items; |
|
|
|
|
|
|
|
@ -79,8 +79,7 @@ namespace Avalonia.NameGenerator.Generator |
|
|
|
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; |
|
|
|
} |
|
|
|
@ -93,4 +92,4 @@ namespace Avalonia.NameGenerator.Generator |
|
|
|
|
|
|
|
void IXamlAstVisitor.Pop() { } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|