Code inspection: Group path is not defined
This inspection flags Odin Inspector layout and grouping attributes whose referenced group path is not defined within the class.
How it works
When using group paths such as A/B/C, Odin requires each prefix in the path to be defined. This analyzer validates each part of the path in order (first A, then A/B, and finally A/B/C). The first missing prefix triggers a warning.
The highlight is placed directly on the missing substring inside the string literal, rather than the entire attribute string. This applies to Odin layout attributes such as:
BoxGroupFoldoutGroupHorizontalGroupVerticalGroupTabGroupToggleGroupTitleGroupHideIfGroupShowIfGroup
The inspection only reports when the group argument is a constant string literal and only after the class is found to use Odin layout attributes.
Using an undefined group path will lead to a runtime error in the Unity Inspector.
Example
In this example, field1 is assigned to a group path "General/Settings", but the prefix "General" has not been defined as a group.