-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolve namespace conflicts in generated code
- Loading branch information
Showing
12 changed files
with
165 additions
and
17 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
+272 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TestResults/ |
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
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
39 changes: 39 additions & 0 deletions
39
...s/Snapshots/ProvideAugmentGeneratorSnapshotTests.It_Handles_Common_Namespaces.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,39 @@ | ||
//HintName: GuiComponent.Provide.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; | ||
using UIComponents; | ||
using System.CodeDom.Compiler; | ||
using UnityEngine.UIElements; | ||
|
||
namespace MyLibrary.GUI | ||
{ | ||
public partial class GuiComponent | ||
{ | ||
[GeneratedCode("UIComponents.Roslyn.Generation", "1.0.0-alpha.1")] | ||
private void UIC_SetProvideField<TField, TCastFrom>(ref TField value, string fieldName) where TField : class where TCastFrom : class | ||
{ | ||
try | ||
{ | ||
value = (TField) (object) Provide<TCastFrom>(); | ||
} | ||
catch (MissingProviderException) | ||
{ | ||
Logger.LogError($"Could not provide {typeof(TField).Name} to {fieldName}", this); | ||
} | ||
catch (InvalidCastException) | ||
{ | ||
Logger.LogError($"Could not cast {typeof(TCastFrom).Name} to {typeof(TField).Name}", this); | ||
} | ||
} | ||
|
||
[GeneratedCode("UIComponents.Roslyn.Generation", "1.0.0-alpha.1")] | ||
protected override void UIC_PopulateProvideFields() | ||
{ | ||
UIC_SetProvideField<Core.Services.IService, Core.Services.IService>(ref service, "service"); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...sts/Snapshots/QueryAugmentGeneratorSnapshotTests.It_Handles_Common_Namespaces.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,24 @@ | ||
//HintName: MyComponent.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 System.CodeDom.Compiler; | ||
using UnityEngine.UIElements; | ||
|
||
namespace MyLibrary.GUI | ||
{ | ||
public partial class MyComponent | ||
{ | ||
[GeneratedCode("UIComponents.Roslyn.Generation", "1.0.0-alpha.1")] | ||
protected override void UIC_PopulateQueryFields() | ||
{ | ||
var UIC_elementList = new List<Core.Elements.MyElement>(); | ||
this.Query<Core.Elements.MyElement>(null, (string) null).ToList(UIC_elementList); | ||
if (UIC_elementList.Count > 0) | ||
element = UIC_elementList[0]; | ||
} | ||
} | ||
} |
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
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
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
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
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