Minor. Parametrize MainFunctionDetector with LanguageVersionSettings
This commit is contained in:
@@ -30,6 +30,7 @@ dependencies {
|
||||
compile(project(":compiler:light-classes")) { isTransitive = false }
|
||||
compile(project(":compiler:frontend")) { isTransitive = false }
|
||||
compile(project(":compiler:frontend.java")) { isTransitive = false }
|
||||
compile(project(":compiler:util")) { isTransitive = false }
|
||||
compile(project(":js:js.frontend")) { isTransitive = false }
|
||||
compile(projectClasses(":idea"))
|
||||
compile(project(":idea:idea-jvm")) { isTransitive = false }
|
||||
|
||||
+3
-2
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.idea.js.asJsModule
|
||||
import org.jetbrains.kotlin.idea.js.jsProductionOutputFilePath
|
||||
import org.jetbrains.kotlin.idea.nodejs.TestElementPath
|
||||
import org.jetbrains.kotlin.idea.nodejs.getNodeJsEnvironmentVars
|
||||
import org.jetbrains.kotlin.idea.project.languageVersionSettings
|
||||
import org.jetbrains.kotlin.idea.run.addBuildTask
|
||||
import org.jetbrains.kotlin.psi.KtNamedDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtNamedFunction
|
||||
@@ -52,7 +53,7 @@ private class KotlinNodeJsRunConfigurationProducer :
|
||||
val jsFilePath = module.jsProductionOutputFilePath ?: return null
|
||||
val declaration = element.getNonStrictParentOfType<KtNamedDeclaration>()
|
||||
if (declaration is KtNamedFunction) {
|
||||
val detector = MainFunctionDetector { it.resolveToDescriptorIfAny() }
|
||||
val detector = MainFunctionDetector(declaration.languageVersionSettings) { it.resolveToDescriptorIfAny() }
|
||||
if (!detector.isMain(declaration, false)) return null
|
||||
} else if (!TestElementPath.isModuleAssociatedDir(element, module)) return null
|
||||
return NodeJsConfigData(element, module, jsFilePath)
|
||||
@@ -81,4 +82,4 @@ private class KotlinNodeJsRunConfigurationProducer :
|
||||
val configData = getConfigurationData(context) ?: return false
|
||||
return configuration.inputPath == configData.jsOutputFilePath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user