From 11a31f7b8a49fca88bd34be0a8b4e8fb00a75417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernest=20Sury=C5=9B?= <32190237+ErnSur@users.noreply.github.com> Date: Sat, 18 Mar 2023 10:38:37 +0100 Subject: [PATCH] Bugfix: Handle UXML root tag without namespace (#23) * added tests and different serialization option * changelog update * example update * remove comment --- Assets/Sandbox/CodeGen/CodeGenExample.gen.cs | 22 ++--- .../CodeGen/CodeGenExample.gen.cs.meta | 2 +- Assets/Sandbox/CodeGen/CodeGenExample.uxml | 2 +- .../com.quickeye.ui-toolkit-plus/CHANGELOG.md | 7 +- .../QuickEye.UxmlBridgeGen/AssemblyInfo.cs | 3 + .../AssemblyInfo.cs.meta | 3 + .../GenCsClassGenerator.cs | 4 +- .../QuickEye.UxmlBridgeGen/InlineSettings.cs | 67 +++++++++------ .../InlineSettingsUtils.cs | 15 ++-- .../QuickEye.UxmlBridgeGen/PackageInfo.cs | 2 +- .../UxmlHeaderDrawer.cs | 4 +- .../Tests/Editor/InlineSettingsTests.cs | 85 +++++++++++++++++++ .../Tests/Editor/InlineSettingsTests.cs.meta | 3 + .../QuickEye.UIToolkit.Editor.Tests.asmdef | 3 +- .../Tests/Editor/Resources.meta | 3 + .../Editor/Resources/uxml-bridge-tests.meta | 8 ++ .../Resources/uxml-bridge-tests/Default.uxml | 9 ++ .../uxml-bridge-tests/Default.uxml.meta | 10 +++ .../uxml-bridge-tests/NoRootNamespace.uxml | 9 ++ .../NoRootNamespace.uxml.meta | 10 +++ .../uxml-bridge-tests/WithCustomSettings.uxml | 10 +++ .../WithCustomSettings.uxml.meta | 10 +++ .../com.quickeye.ui-toolkit-plus/package.json | 2 +- Packages/manifest.json | 4 +- Packages/packages-lock.json | 4 +- ProjectSettings/ProjectVersion.txt | 4 +- 26 files changed, 243 insertions(+), 62 deletions(-) create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Editor/QuickEye.UxmlBridgeGen/AssemblyInfo.cs create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Editor/QuickEye.UxmlBridgeGen/AssemblyInfo.cs.meta create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/InlineSettingsTests.cs create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/InlineSettingsTests.cs.meta create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/Resources.meta create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/Resources/uxml-bridge-tests.meta create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/Resources/uxml-bridge-tests/Default.uxml create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/Resources/uxml-bridge-tests/Default.uxml.meta create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/Resources/uxml-bridge-tests/NoRootNamespace.uxml create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/Resources/uxml-bridge-tests/NoRootNamespace.uxml.meta create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/Resources/uxml-bridge-tests/WithCustomSettings.uxml create mode 100644 Packages/com.quickeye.ui-toolkit-plus/Tests/Editor/Resources/uxml-bridge-tests/WithCustomSettings.uxml.meta diff --git a/Assets/Sandbox/CodeGen/CodeGenExample.gen.cs b/Assets/Sandbox/CodeGen/CodeGenExample.gen.cs index 6b89391..94e3fa1 100644 --- a/Assets/Sandbox/CodeGen/CodeGenExample.gen.cs +++ b/Assets/Sandbox/CodeGen/CodeGenExample.gen.cs @@ -1,7 +1,7 @@ // ----------------------- // script auto-generated // any changes to this file will be lost on next code generation -// com.quickeye.ui-toolkit-plus ver: 2.0.0 +// com.quickeye.ui-toolkit-plus ver: 3.0.3 // ----------------------- using UnityEngine.UIElements; @@ -9,19 +9,19 @@ namespace SampleAsmDefName { partial class CodeGenExample { - private Label _title; - private VisualElement _menu; - private Button _confirmButton; - private QuickEye.UIToolkit.Tab _normalTab; - private QuickEye.UIToolkit.TabGroup _dropTab; + private Label title; + private VisualElement menu; + private Button confirmButton; + private QuickEye.UIToolkit.Tab normalTab; + private QuickEye.UIToolkit.TabGroup dropTab; protected void AssignQueryResults(VisualElement root) { - _title = root.Q