Set JVM target from facet settings on compiler configuration creation
Otherwise analyse in IDE is perfomed under default JVM target and wrong diagnostics are reported. #KT-16329 In Progress
This commit is contained in:
@@ -145,6 +145,13 @@ private fun getExtraLanguageFeatures(
|
|||||||
|
|
||||||
fun KtElement.createCompilerConfiguration(): CompilerConfiguration = CompilerConfiguration().apply {
|
fun KtElement.createCompilerConfiguration(): CompilerConfiguration = CompilerConfiguration().apply {
|
||||||
languageVersionSettings = this@createCompilerConfiguration.languageVersionSettings
|
languageVersionSettings = this@createCompilerConfiguration.languageVersionSettings
|
||||||
|
|
||||||
|
val module = ModuleUtilCore.findModuleForPsiElement(this@createCompilerConfiguration)
|
||||||
|
val platform = module?.targetPlatform?.version
|
||||||
|
if (platform is JvmTarget) {
|
||||||
|
put(JVMConfigurationKeys.JVM_TARGET, platform)
|
||||||
|
}
|
||||||
|
|
||||||
isReadOnly = true
|
isReadOnly = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user