@@ -307,7 +307,7 @@ class EmberUtils {
307
307
if (cls is TypeScriptVariable ) {
308
308
if (cls.jsType.toString().startsWith(" TOC<" ) || cls.jsType.toString().startsWith(" TemplateOnlyComponent<" )) {
309
309
val arg = (cls.jsType as JSGenericTypeImpl ).arguments[0 ]
310
- return arg.asRecordType().properties.find { it.memberName == " Args" }?.jsType?.asRecordType()
310
+ return arg.asRecordType().properties.find { it.memberName == " Args" }?.jsType?.asRecordType() ? : arg.asRecordType()
311
311
}
312
312
return cls.jsType?.asRecordType()?.callSignatures?.firstOrNull()?.returnType?.asRecordType()?.properties?.find { it.memberName == " Context" }?.jsType?.asRecordType()?.properties?.find { it.memberName == " args" }?.jsType?.asRecordType()
313
313
}
@@ -958,8 +958,9 @@ class EmberUtils {
958
958
}
959
959
}
960
960
val tsClass = (cls as ? JSClass )
961
- var blocks: JSRecordType . PropertySignature ? = null
962
- var args: JSRecordType . PropertySignature ? = null
961
+ var blocks: JSRecordType .PropertySignature ? = null
962
+ var args: JSRecordType .PropertySignature ? = null
963
+ var arg: JSType ? = null
963
964
val supers = tsClass?.superClasses?.asList()?.toTypedArray<JSClass >()
964
965
val classes = mutableListOf<JSClass ?>()
965
966
classes.add(tsClass)
@@ -974,7 +975,7 @@ class EmberUtils {
974
975
}
975
976
if (cls is TypeScriptVariable ) {
976
977
if (cls.jsType.toString().startsWith(" TOC<" ) || cls.jsType.toString().startsWith(" TemplateOnlyComponent<" )) {
977
- val arg = (cls.jsType as JSGenericTypeImpl ).arguments[0 ]
978
+ arg = (cls.jsType as JSGenericTypeImpl ).arguments[0 ]
978
979
blocks = arg.asRecordType().properties.find { it.memberName == " Blocks" }
979
980
args = arg.asRecordType().properties.find { it.memberName == " Args" }
980
981
}
@@ -985,8 +986,8 @@ class EmberUtils {
985
986
it.memberSource.singleElement?.let { tplYields.add(EmberXmlElementDescriptor .YieldReference (it)) }
986
987
}
987
988
}
988
- if (args != null ) {
989
- val arguments = args?.jsType?.asRecordType()?.properties
989
+ if (args != null || arg != null ) {
990
+ val arguments = args?.jsType?.asRecordType()?.properties ? : args?.jsType?.asRecordType()?.properties
990
991
arguments?.forEach {
991
992
if (it.memberSource.singleElement != null ) {
992
993
tplArgs.add(ArgData (it.memberName, " " , AttrPsiReference (it.memberSource.singleElement!! )))
0 commit comments