-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ignore using declarations with alias during codegen
- Loading branch information
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
Binary file modified
BIN
+512 Bytes
(100%)
Assets/UIComponents/Roslyn/UIComponents.Roslyn.Generation.dll
Binary file not shown.
Binary file modified
BIN
+24 Bytes
(100%)
Assets/UIComponents/Roslyn/UIComponents.Roslyn.Generation.pdb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...ts/QueryAugmentGeneratorSnapshotTests.It_Handles_Using_Declaration_With_Alias.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//HintName: UsingAliasComponent.Query.g.cs | ||
// <auto-generated> | ||
// This file has been generated automatically by UIComponents.Roslyn. | ||
// Do not attempt to modify it. Any changes will be overridden during compilation. | ||
// </auto-generated> | ||
|
||
using System.Collections.Generic; | ||
using UnityEngine.UIElements; | ||
using UIComponents; | ||
using System.CodeDom.Compiler; | ||
|
||
public partial class UsingAliasComponent | ||
{ | ||
[GeneratedCode("UIComponents.Roslyn.Generation", "1.0.0-alpha.4")] | ||
protected override void UIC_PopulateQueryFields() | ||
{ | ||
// firstButton | ||
var UIC_firstButtonList = new List<MyLibrary.Button>(); | ||
this.Query<MyLibrary.Button>(null, (string) null).ToList(UIC_firstButtonList); | ||
this.Query<MyLibrary.Button>(null, "test").ToList(UIC_firstButtonList); | ||
if (UIC_firstButtonList.Count == 0) | ||
Logger.LogError("Query (firstButton): No instances of MyLibrary.Button found", this); | ||
if (UIC_firstButtonList.Count > 0) | ||
firstButton = UIC_firstButtonList[0]; | ||
|
||
// buttonArray | ||
var UIC_buttonArrayList = new List<MyLibrary.Button>(); | ||
this.Query<MyLibrary.Button>("uxml-name", "class").ToList(UIC_buttonArrayList); | ||
this.Query<MyLibrary.Button>(null, "class-name").ToList(UIC_buttonArrayList); | ||
if (UIC_buttonArrayList.Count == 0) | ||
Logger.LogError("Query (buttonArray): No instances of MyLibrary.Button found", this); | ||
buttonArray = new MyLibrary.Button[UIC_buttonArrayList.Count]; | ||
for (var i = 0; i < UIC_buttonArrayList.Count; i++) | ||
buttonArray[i] = UIC_buttonArrayList[i]; | ||
|
||
// buttonList | ||
var UIC_buttonListList = new List<MyLibrary.Button>(); | ||
this.Query<MyLibrary.Button>("name", "class").ToList(UIC_buttonListList); | ||
this.Query<MyLibrary.Button>("other-name", "other-class").ToList(UIC_buttonListList); | ||
this.Query<MyLibrary.Button>("third-name", "third-class").ToList(UIC_buttonListList); | ||
if (UIC_buttonListList.Count == 0) | ||
Logger.LogError("Query (buttonList): No instances of MyLibrary.Button found", this); | ||
buttonList = UIC_buttonListList; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters