[IDE] Drop coroutines combo box from compiler configuration tab

This commit is contained in:
Dmitriy Novozhilov
2020-12-02 12:59:16 +03:00
committed by TeamCityServer
parent 0fef890d1a
commit 69e1d60b08
5 changed files with 2 additions and 68 deletions
@@ -1850,7 +1850,6 @@ destination.directory=&Destination directory
language.version=&Language version
add.prefix.to.paths.in.source.map=Add prefix to paths in source map:
api.version=AP&I version
compiler.coroutines=Coro&utines
embed.source.code.into.source.map=Embed source code into source map:
enable.incremental.compilation=Enable incremental compilation
keep.compiler.process.alive.between.invocations=Keep compiler process alive between invocations
@@ -2222,4 +2221,4 @@ hints.codevision.inheritors.to_many.format={0,number}+ Inheritors
hints.codevision.overrides.format={0, choice, 1#1 Override|2#{0,number} Overrides}
hints.codevision.overrides.to_many.format={0,number}+ Overrides
hints.codevision.settings=Settings...
inspection.unused.result.of.data.class.copy=Unused result of data class copy
inspection.unused.result.of.data.class.copy=Unused result of data class copy
@@ -331,30 +331,6 @@
</component>
</children>
</grid>
<grid id="7f3d" binding="coroutinesPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="12453" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/KotlinBundle" key="compiler.coroutines"/>
</properties>
</component>
<component id="4cb8f" class="javax.swing.JComboBox" binding="coroutineSupportComboBox">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
</children>
</grid>
<component id="ba279" class="javax.swing.JLabel" binding="additionalArgsLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
@@ -103,7 +103,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
private JPanel k2jsPanel;
private JComboBox jvmVersionComboBox;
private JComboBox<VersionView> languageVersionComboBox;
private JComboBox coroutineSupportComboBox;
private JComboBox<VersionView> apiVersionComboBox;
private JPanel scriptPanel;
private JLabel labelForOutputPrefixFile;
@@ -141,7 +140,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
additionalArgsOptionsField.attachLabel(additionalArgsLabel);
fillLanguageAndAPIVersionList();
fillCoroutineSupportList();
if (CidrUtil.isRunningInCidrIde()) {
keepAliveCheckBox.setVisible(false);
@@ -382,14 +380,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
apiVersionComboBox.setRenderer(new DescriptionListCellRenderer());
}
@SuppressWarnings("unchecked")
private void fillCoroutineSupportList() {
for (LanguageFeature.State coroutineSupport : languageFeatureStates) {
coroutineSupportComboBox.addItem(coroutineSupport);
}
coroutineSupportComboBox.setRenderer(new DescriptionListCellRenderer());
}
public void setTargetPlatform(@Nullable IdePlatformKind<?> targetPlatform) {
k2jsPanel.setVisible(JsIdePlatformUtil.isJavaScript(targetPlatform));
scriptPanel.setVisible(JvmIdePlatformUtil.isJvm(targetPlatform));
@@ -444,7 +434,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
return isModified(reportWarningsCheckBox, !commonCompilerArguments.getSuppressWarnings()) ||
!getSelectedLanguageVersionView().equals(KotlinFacetSettingsKt.getLanguageVersionView(commonCompilerArguments)) ||
!getSelectedAPIVersionView().equals(KotlinFacetSettingsKt.getApiVersionView(commonCompilerArguments)) ||
!getSelectedCoroutineState().equals(commonCompilerArguments.getCoroutinesState()) ||
!additionalArgsOptionsField.getText().equals(compilerSettings.getAdditionalArguments()) ||
isModified(scriptTemplatesField, compilerSettings.getScriptTemplates()) ||
isModified(scriptTemplatesClasspathField, compilerSettings.getScriptTemplatesClasspath()) ||
@@ -492,26 +481,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
return item != null ? (VersionView) item : VersionView.LatestStable.INSTANCE;
}
@NotNull
private String getSelectedCoroutineState() {
if (getSelectedLanguageVersionView().getVersion().compareTo(LanguageVersion.KOTLIN_1_3) >= 0) {
return CommonCompilerArguments.DEFAULT;
}
LanguageFeature.State state = (LanguageFeature.State) coroutineSupportComboBox.getSelectedItem();
if (state == null) return CommonCompilerArguments.DEFAULT;
switch (state) {
case ENABLED:
return CommonCompilerArguments.ENABLE;
case ENABLED_WITH_WARNING:
return CommonCompilerArguments.WARN;
case ENABLED_WITH_ERROR:
return CommonCompilerArguments.ERROR;
default:
return CommonCompilerArguments.DEFAULT;
}
}
public void applyTo(
CommonCompilerArguments commonCompilerArguments,
K2JVMCompilerArguments k2jvmCompilerArguments,
@@ -522,7 +491,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
boolean shouldInvalidateCaches =
!getSelectedLanguageVersionView().equals(KotlinFacetSettingsKt.getLanguageVersionView(commonCompilerArguments)) ||
!getSelectedAPIVersionView().equals(KotlinFacetSettingsKt.getApiVersionView(commonCompilerArguments)) ||
!getSelectedCoroutineState().equals(commonCompilerArguments.getCoroutinesState()) ||
!additionalArgsOptionsField.getText().equals(compilerSettings.getAdditionalArguments());
if (shouldInvalidateCaches) {
@@ -542,8 +510,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
KotlinFacetSettingsKt.setLanguageVersionView(commonCompilerArguments, getSelectedLanguageVersionView());
KotlinFacetSettingsKt.setApiVersionView(commonCompilerArguments, getSelectedAPIVersionView());
commonCompilerArguments.setCoroutinesState(getSelectedCoroutineState());
compilerSettings.setAdditionalArguments(additionalArgsOptionsField.getText());
compilerSettings.setScriptTemplates(scriptTemplatesField.getText());
compilerSettings.setScriptTemplatesClasspath(scriptTemplatesClasspathField.getText());
@@ -595,7 +561,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
setSelectedItem(languageVersionComboBox, KotlinFacetSettingsKt.getLanguageVersionView(commonCompilerArguments));
onLanguageLevelChanged((VersionView) languageVersionComboBox.getSelectedItem()); // getSelectedLanguageVersionView() replaces null
setSelectedItem(apiVersionComboBox, KotlinFacetSettingsKt.getApiVersionView(commonCompilerArguments));
coroutineSupportComboBox.setSelectedItem(CoroutineSupport.byCompilerArguments(commonCompilerArguments));
additionalArgsOptionsField.setText(compilerSettings.getAdditionalArguments());
scriptTemplatesField.setText(compilerSettings.getScriptTemplates());
scriptTemplatesClasspathField.setText(compilerSettings.getScriptTemplatesClasspath());
@@ -701,10 +666,6 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable {
return apiVersionComboBox;
}
public JComboBox getCoroutineSupportComboBox() {
return coroutineSupportComboBox;
}
public void setEnabled(boolean value) {
isEnabled = value;
UIUtil.setEnabled(getContentPane(), value, true);
@@ -347,7 +347,6 @@ class KotlinFacetEditorGeneralTab(
doValidate()
}
apiVersionComboBox.validateOnChange()
coroutineSupportComboBox.validateOnChange()
}
editor.targetPlatformSelectSingleCombobox.validateOnChange()
@@ -45,7 +45,6 @@ class MultipleKotlinFacetEditor(
helper.bind(scriptTemplatesClasspathField, editors) { it.compilerConfigurable.scriptTemplatesClasspathField }
helper.bind(languageVersionComboBox, editors) { it.compilerConfigurable.languageVersionComboBox }
helper.bind(apiVersionComboBox, editors) { it.compilerConfigurable.apiVersionComboBox }
helper.bind(coroutineSupportComboBox, editors) { it.compilerConfigurable.coroutineSupportComboBox }
}
}
}
@@ -56,4 +55,4 @@ class MultipleKotlinFacetEditor(
// Their settings might have changed to non-project one due to UI control binding
editors.map { it.tabEditor }.filter { it.useProjectSettingsCheckBox.isSelected }.forEach { it.updateCompilerConfigurable() }
}
}
}