@@ -129,32 +129,32 @@ private static UxmlAttributeInfo GetAttributeInfo(GeneratorExecutionContext cont
129
129
130
130
var info = new UxmlAttributeInfo
131
131
{
132
- TypeIdentifier = GetPropertyTypeIdentifier ( context , property , out var typeSyntax ) ,
132
+ TypeIdentifier = GetPropertyTypeIdentifier ( context , property , out var predefinedTypeSyntax ) ,
133
133
PrivateFieldName = propertyName . ToPrivateFieldName ( ) ,
134
134
AttributeUxmlName = propertyName . ToDashCase ( )
135
135
} ;
136
136
137
- if ( uxmlAttributeDefaultValue is null || typeSyntax is null )
137
+ if ( uxmlAttributeDefaultValue is null || predefinedTypeSyntax is null )
138
138
{
139
139
info . DefaultValueAssignmentExpression =
140
140
LiteralExpression ( SyntaxKind . DefaultLiteralExpression , Token ( SyntaxKind . DefaultKeyword ) ) ;
141
141
return info ;
142
142
}
143
143
144
- if ( typeSyntax . IsBoolType ( ) )
144
+ if ( predefinedTypeSyntax . IsBoolType ( ) )
145
145
{
146
146
info . DefaultValueAssignmentExpression = IdentifierName ( uxmlAttributeDefaultValue ) ;
147
147
return info ;
148
148
}
149
149
150
- if ( typeSyntax . IsStringType ( ) )
150
+ if ( predefinedTypeSyntax . IsStringType ( ) )
151
151
{
152
152
info . DefaultValueAssignmentExpression = LiteralExpression ( SyntaxKind . StringLiteralExpression ,
153
153
Literal ( uxmlAttributeDefaultValue ) ) ;
154
154
return info ;
155
155
}
156
156
157
- if ( typeSyntax . IsNumericType ( ) )
157
+ if ( predefinedTypeSyntax . IsNumericType ( ) )
158
158
{
159
159
info . DefaultValueAssignmentExpression = LiteralExpression ( SyntaxKind . NumericLiteralExpression ,
160
160
Literal ( uxmlAttributeDefaultValue , uxmlAttributeDefaultValue ) ) ;
@@ -172,15 +172,15 @@ private static UxmlAttributeInfo GetAttributeInfo(GeneratorExecutionContext cont
172
172
}
173
173
174
174
private static string GetPropertyTypeIdentifier ( GeneratorExecutionContext context ,
175
- BasePropertyDeclarationSyntax property , out TypeSyntax ? typeSyntax )
175
+ BasePropertyDeclarationSyntax property , out PredefinedTypeSyntax ? predefinedTypeSyntax )
176
176
{
177
177
switch ( property . Type )
178
178
{
179
179
case PredefinedTypeSyntax predefinedType :
180
180
{
181
181
var propertyTypeIdentifier = predefinedType . Keyword . Text . FirstCharToUpper ( ) ;
182
182
183
- typeSyntax = predefinedType ;
183
+ predefinedTypeSyntax = predefinedType ;
184
184
185
185
return $ "Uxml{ propertyTypeIdentifier } AttributeDescription";
186
186
}
@@ -191,15 +191,15 @@ private static string GetPropertyTypeIdentifier(GeneratorExecutionContext contex
191
191
var typeNamespace = customTypeSyntax . GetTypeNamespace ( context ) ;
192
192
var propertyTypeText = $ "global::{ typeNamespace } .{ type } ";
193
193
194
- typeSyntax = customTypeSyntax ;
194
+ predefinedTypeSyntax = default ;
195
195
196
196
return propertyTypeText == UnityColorTypeFullName
197
197
? UxmlColorAttributeDescription
198
198
: $ "UxmlEnumAttributeDescription<{ propertyTypeText } >";
199
199
}
200
200
201
201
default :
202
- typeSyntax = default ;
202
+ predefinedTypeSyntax = default ;
203
203
return property . Type . GetText ( ) . ToString ( ) . Trim ( ) ;
204
204
}
205
205
}
0 commit comments