[kotlin] For facets, try to get Kotlin compiler version from KotlinJpsPluginSettings to restrict max LV and AV

^KTIJ-33046 Fixed

Merge-request: IJ-MR-166999
Merged-by: Victoria Petrakovich <Victoria.Petrakovich@jetbrains.com>

GitOrigin-RevId: e92255bd8a3baee79c90541d108f8b15dd2ac07b
This commit is contained in:
Victoria.Petrakovich
2025-06-26 16:16:13 +00:00
committed by intellij-monorepo-bot
parent 69ad8b643d
commit effa29af25
@@ -363,9 +363,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
}
apiVersionComboBox.setModel(new MutableCollectionComboBoxModel<>(permittedAPIVersions));
if (isJpsCompilerVisible()) {
languageVersionComboBox.setModel(new MutableCollectionComboBoxModel<>(permittedAPIVersions));
}
languageVersionComboBox.setModel(new MutableCollectionComboBoxModel<>(permittedAPIVersions));
VersionView selectedItem =
VersionComparatorUtil.compare(selectedAPIVersion.getVersionString(), upperBound.getVersionString()) <= 0
@@ -636,7 +634,14 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
JpsVersionItem selectedItem = (JpsVersionItem) kotlinJpsPluginVersionComboBox.getSelectedItem();
IdeKotlinVersion version = selectedItem != null ? selectedItem.getVersion() : null;
LanguageVersion languageVersion = version != null ? LanguageVersion.fromFullVersionString(version.toString()) : null;
return languageVersion != null ? new VersionView.Specific(languageVersion) : getLatestStableVersion();
VersionView versionView;
if (languageVersion != null) {
versionView = new VersionView.Specific(languageVersion);
} else {
String compilerVersionFromSettings = KotlinJpsPluginSettings.getInstance(project).getSettings().getVersion();
versionView = VersionView.Companion.deserialize(compilerVersionFromSettings, /*isAutoAdvance =*/ false);
}
return versionView;
}
private @NotNull String getSelectedKotlinJpsPluginVersion() {