Skip to content

Conversation

K-Tone
Copy link
Collaborator

@K-Tone K-Tone commented Jun 26, 2025

Description

Unity 6.2 deprecated some older TreeView functionality in favour of generic versions, and it's advised to use either TreeView<int> or TreeView<InstanceID> where appropriate. In our case, using the <int> variants seemed to be enough.

Testing status & QA

Local testing, pending QA pass

Overall Product Risks

  • Complexity: Low
  • Halo Effect: Low

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@K-Tone K-Tone requested a review from Copilot June 26, 2025 10:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request addresses the 6.2 compilation issues for the treeview by updating several package dependencies and adding conditional using directives for generics-based TreeView types to support newer Unity versions. It also includes minor lambda formatting changes in the debugger components to improve code clarity.

  • Updated dependency versions in Packages/manifest.json to ensure compatibility.
  • Added UNITY_6000_2_OR_NEWER conditional blocks with generic TreeView type aliases across several editor files.
  • Reformatted lambda expressions in InputDebuggerWindow.cs for improved readability.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Packages/manifest.json Updated package dependency versions to resolve compilation issues.
Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HIDDescriptorWindow.cs Added conditional generic TreeView type aliases.
Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionMapDrawer.cs Added conditional generic TreeViewItem alias.
Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawerBase.cs Added conditional generic TreeViewItem alias.
Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawer.cs Added conditional generic TreeViewItem alias.
Packages/com.unity.inputsystem/InputSystem/Editor/Internal/TreeViewHelpers.cs Added conditional generic TreeView and TreeViewItem aliases.
Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs Added conditional generic TreeViewState alias.
Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputEventTreeView.cs Added conditional generic TreeView, TreeViewItem, and TreeViewState aliases.
Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputControlTreeView.cs Added conditional generic TreeView, TreeViewItem, and TreeViewState aliases.
Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs Added conditional generic TreeViewState alias.
Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs Reformatted lambda expressions and added conditional generic using directives for TreeView types.
Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeViewItems.cs Added conditional generic TreeViewItem alias.
Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs Added conditional generic TreeView, TreeViewItem, and TreeViewState aliases.
Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs Added conditional generic TreeView and TreeViewState aliases.

"com.unity.test-framework.performance": "3.1.0",
"com.unity.test-framework.utp-reporter": "1.1.0-preview",
"com.unity.textmeshpro": "3.0.6",
"com.unity.ugui": "2.0.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this is was not intentional, I'll revert

#if UNITY_6000_2_OR_NEWER
using TreeView = UnityEditor.IMGUI.Controls.TreeView<int>;
using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState<int>;
#endif
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This using section was the intentional scope of changes, but VS code formatted some code as well behind the scenes - adding some spaces here and there. Initially I thought to revert, but looking through them I liked the changes so why revert? Left them in the end.

@K-Tone K-Tone changed the title fix up the 6.2 compilation treeview compilation issues, inspired by S… FIX: Address the TreeView compilation warnings when used with Unity 6.2 beta Jun 26, 2025
@K-Tone K-Tone requested review from Pauliusd01 and ritamerkl June 26, 2025 10:17
@K-Tone K-Tone marked this pull request as ready for review June 26, 2025 10:22
Copy link
Collaborator

@ritamerkl ritamerkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, were there some files missing in Stefans attempt? why were there errors trying this before?

@K-Tone
Copy link
Collaborator Author

K-Tone commented Jun 26, 2025

LGTM, were there some files missing in Stefans attempt? why were there errors trying this before?

I don't know what errors Paulius met, but what I saw was that you needed to add usings into all the files where we have the TreeView stuff and unless you do that, the compiler keeps complaining that some methods are missing somewhere. Apparently we have about a dozen classes that depend on TreeView and you have to update them in one go, can't change one file, get green run - because other 9 classes are missing stuff now etc.

Copy link
Collaborator

@Pauliusd01 Pauliusd01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm checked on 22.3 and latest trunk

@codecov-github-com
Copy link

codecov-github-com bot commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...InputSystem/Editor/Debugger/InputDebuggerWindow.cs 0.00% 4 Missing ⚠️
...stem/Editor/AssetEditor/InputActionEditorWindow.cs 0.00% 2 Missing ⚠️
...utSystem/Editor/AssetEditor/InputActionTreeView.cs 85.71% 1 Missing ⚠️
.../InputSystem/Editor/Internal/InputEventTreeView.cs 0.00% 1 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2196      +/-   ##
===========================================
- Coverage    67.80%   67.80%   -0.01%     
===========================================
  Files          367      367              
  Lines        53536    53538       +2     
===========================================
  Hits         36299    36299              
- Misses       17237    17239       +2     
Flag Coverage Δ
mac_2021.3_pkg 5.41% <0.00%> (-0.01%) ⬇️
mac_2021.3_project 70.42% <42.85%> (-0.01%) ⬇️
mac_2022.3_pkg 5.19% <0.00%> (-0.01%) ⬇️
mac_2022.3_project 65.28% <42.85%> (-0.01%) ⬇️
mac_6000.0_pkg 5.20% <0.00%> (-0.01%) ⬇️
mac_6000.0_project 67.70% <42.85%> (-0.01%) ⬇️
mac_6000.1_pkg 5.20% <0.00%> (-0.01%) ⬇️
mac_6000.1_project 67.70% <42.85%> (-0.02%) ⬇️
mac_6000.2_pkg 5.20% <0.00%> (-0.01%) ⬇️
mac_6000.2_project 67.70% <42.85%> (+<0.01%) ⬆️
mac_trunk_pkg 5.20% <0.00%> (-0.01%) ⬇️
mac_trunk_project 67.69% <42.85%> (-0.01%) ⬇️
win_2021.3_pkg 5.41% <0.00%> (-0.01%) ⬇️
win_2021.3_project 70.49% <42.85%> (-0.01%) ⬇️
win_2022.3_pkg 5.19% <0.00%> (-0.01%) ⬇️
win_2022.3_project 65.35% <42.85%> (-0.01%) ⬇️
win_6000.0_pkg 5.20% <0.00%> (-0.01%) ⬇️
win_6000.0_project 67.77% <42.85%> (-0.01%) ⬇️
win_6000.1_pkg 5.20% <0.00%> (-0.01%) ⬇️
win_6000.1_project 67.78% <42.85%> (+0.01%) ⬆️
win_6000.2_pkg 5.20% <0.00%> (-0.01%) ⬇️
win_6000.2_project 67.77% <42.85%> (+0.10%) ⬆️
win_trunk_pkg 5.20% <0.00%> (-0.01%) ⬇️
win_trunk_project 67.77% <42.85%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...tem/Editor/AssetEditor/InputActionTreeViewItems.cs 74.91% <ø> (ø)
...ystem/Editor/Debugger/InputDeviceDebuggerWindow.cs 0.27% <ø> (ø)
...nputSystem/Editor/Internal/InputControlTreeView.cs 0.00% <ø> (ø)
...em/InputSystem/Editor/Internal/InputStateWindow.cs 0.00% <ø> (ø)
...tem/InputSystem/Editor/Internal/TreeViewHelpers.cs 65.38% <ø> (ø)
...System/Editor/PropertyDrawers/InputActionDrawer.cs 0.00% <ø> (ø)
...em/Editor/PropertyDrawers/InputActionDrawerBase.cs 0.00% <ø> (ø)
...tem/Editor/PropertyDrawers/InputActionMapDrawer.cs 0.00% <ø> (ø)
...tem/InputSystem/Plugins/HID/HIDDescriptorWindow.cs 0.00% <ø> (ø)
...utSystem/Editor/AssetEditor/InputActionTreeView.cs 50.20% <85.71%> (ø)
... and 3 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@K-Tone K-Tone merged commit e399779 into develop Jun 27, 2025
131 checks passed
@K-Tone K-Tone deleted the anthony/isx-6.2-treeview-compilation-issues branch June 27, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants