diff --git a/src/main/kotlin/com/emberjs/gts/GtsSupport.kt b/src/main/kotlin/com/emberjs/gts/GtsSupport.kt index 5b7d8028..5a971e3f 100644 --- a/src/main/kotlin/com/emberjs/gts/GtsSupport.kt +++ b/src/main/kotlin/com/emberjs/gts/GtsSupport.kt @@ -602,7 +602,9 @@ val GTS_DEFAULT_EXTENSIONS_WITH_DOT = arrayOf(".gts", ".gjs") class GtsImportResolver(project: Project, resolveContext: JSImportResolveContext, - private val contextFile: VirtualFile): TypeScriptFileImportsResolverImpl(project, resolveContext, GTS_DEFAULT_EXTENSIONS_WITH_DOT, listOf(GtsFileType.INSTANCE)) { + private val contextFile: VirtualFile): + TypeScriptFileImportsResolverImpl(project, resolveContext, GTS_DEFAULT_EXTENSIONS_WITH_DOT, listOf(GtsFileType.INSTANCE, GjsFileType.INSTANCE +)) { override fun processAllFilesInScope(includeScope: GlobalSearchScope, processor: Processor) { if (includeScope == GlobalSearchScope.EMPTY_SCOPE) return @@ -621,6 +623,9 @@ class GtsImportResolver(project: Project, TypeScriptImportsResolverProvider.getDefaultProvider(project, resolveContext) .resolveFileModule("gts", contextFile) ?.let { processor.process(it) } + TypeScriptImportsResolverProvider.getDefaultProvider(project, resolveContext) + .resolveFileModule("gjs", contextFile) + ?.let { processor.process(it) } } override fun getPriority(): Int = TypeScriptFileImportsResolver.JS_DEFAULT_PRIORITY @@ -660,6 +665,13 @@ class GtsComponentCandidatesProvider(val placeInfo: JSImportPlaceInfo) : JSImpor .flatten() .toMutableList() + list.addAll(FilenameIndex.getAllFilesByExt(project, "gjs", + createProjectImportsScope(placeInfo, getStructureModuleRoot(placeInfo))) + .map { getExports(it) } + .flatten() + .toMutableList() + ) + val scopes = EmberUtils.getScopesForFile(myPlaceInfo.file) val scope = ProjectScope.getAllScope(project) @@ -728,6 +740,9 @@ class GtsComponentCandidatesProvider(val placeInfo: JSImportPlaceInfo) : JSImpor return if (virtualFile.name == "index.gts") { virtualFile.parent.name } + else if (virtualFile.name == "index.gjs") { + virtualFile.parent.name + } else { virtualFile.nameWithoutExtension }