@@ -6,9 +6,11 @@ import com.dmarcotte.handlebars.parsing.HbTokenTypes
66import com.dmarcotte.handlebars.psi.*
77import com.dmarcotte.handlebars.psi.impl.HbPathImpl
88import com.emberjs.cli.EmberCliFrameworkDetector
9+ import com.emberjs.gts.GjsLanguage
910import com.emberjs.gts.GtsElementTypes
1011import com.emberjs.gts.GtsFile
1112import com.emberjs.gts.GtsFileViewProvider
13+ import com.emberjs.gts.GtsLanguage
1214import com.emberjs.hbs.*
1315import com.emberjs.index.EmberNameIndex
1416import com.emberjs.navigation.EmberGotoRelatedProvider
@@ -844,6 +846,12 @@ class EmberUtils {
844846 }
845847 }
846848 }
849+
850+ if (cls is TypeScriptVariable ) {
851+ jsTemplate = f.containingFile.viewProvider.findElementAt(cls.children[1 ].textOffset, JavaScriptSupportLoader .TYPESCRIPT )
852+ } else if (cls is JSVariable ) {
853+ jsTemplate = f.containingFile.viewProvider.findElementAt(cls.children[1 ].textOffset, JavaScriptSupportLoader .ECMA_SCRIPT_6 )
854+ }
847855 }
848856
849857 template = dir?.findFile(" $name .hbs" ) ? : dir?.findFile(" template.hbs" ) ? : dir?.findFile(" template.ts" ) ? : dir?.findFile(" template.js" )
@@ -936,6 +944,13 @@ class EmberUtils {
936944 }
937945 }
938946 }
947+ if (cls is TypeScriptVariable ) {
948+ if (cls.jsType.toString().startsWith(" TOC<" ) || cls.jsType.toString().startsWith(" TemplateOnlyComponent<" )) {
949+ val arg = (cls.jsType as JSGenericTypeImpl ).arguments[0 ]
950+ blocks = arg.asRecordType().properties.find { it.memberName == " Blocks" }
951+ args = arg.asRecordType().properties.find { it.memberName == " Args" }
952+ }
953+ }
939954 if (blocks != null ) {
940955 val yields = blocks?.jsType?.asRecordType()?.properties
941956 yields?.forEach {
0 commit comments