Depend on passed language version explicitly to compute nullability annotation settings

This commit is contained in:
Victor Petukhov
2021-06-11 10:25:29 +03:00
parent 18384788a4
commit a82772f31a
16 changed files with 102 additions and 47 deletions
@@ -75,11 +75,13 @@ object IDELanguageSettingsProvider : LanguageSettingsProvider {
for (module in ModuleManager.getInstance(project).modules) {
val settings = KotlinFacetSettingsProvider.getInstance(project)?.getSettings(module) ?: continue
val compilerArguments = settings.mergedCompilerArguments as? K2JVMCompilerArguments ?: continue
val kotlinVersion = settings.languageLevel?.toKotlinVersion() ?: KotlinVersion.CURRENT
result = JavaTypeEnhancementStateParser(MessageCollector.NONE).parse(
result = JavaTypeEnhancementStateParser(MessageCollector.NONE, kotlinVersion).parse(
compilerArguments.jsr305,
compilerArguments.supportCompatqualCheckerFrameworkAnnotations,
compilerArguments.jspecifyAnnotations
compilerArguments.jspecifyAnnotations,
compilerArguments.nullabilityAnnotations
)
}