diff --git a/jps-plugin/src/org/jetbrains/jps/incremental/scala/model/CompilerSettingsImpl.java b/jps-plugin/src/org/jetbrains/jps/incremental/scala/model/CompilerSettingsImpl.java index 8d4b37fc5e1..e065a0e8715 100644 --- a/jps-plugin/src/org/jetbrains/jps/incremental/scala/model/CompilerSettingsImpl.java +++ b/jps-plugin/src/org/jetbrains/jps/incremental/scala/model/CompilerSettingsImpl.java @@ -90,6 +90,10 @@ public String[] getCompilerOptions() { list.add("-P:continuations:enable"); } + if (myState.experimental) { + list.add("-Xexperimental"); + } + switch (myState.debuggingInfoLevel) { case None: list.add("-g:none"); @@ -146,6 +150,8 @@ public static class State { public boolean macros; + public boolean experimental; + public boolean warnings = true; //no -nowarn public boolean deprecationWarnings; diff --git a/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettings.scala b/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettings.scala index a82966e3007..b60475ddb7a 100644 --- a/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettings.scala +++ b/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettings.scala @@ -21,6 +21,7 @@ class ScalaCompilerSettings(state: ScalaCompilerSettingsState) { var higherKinds: Boolean = _ var existentials: Boolean = _ var macros: Boolean = _ + var experimental: Boolean = _ var warnings: Boolean = _ var deprecationWarnings: Boolean = _ @@ -43,6 +44,7 @@ class ScalaCompilerSettings(state: ScalaCompilerSettingsState) { ("-language:higherKinds", () => higherKinds, higherKinds = _), ("-language:existentials", () => existentials, existentials = _), ("-language:macros", () => macros, macros = _), + ("-Xexperimental", () => experimental, experimental = _), ("-nowarn", () => !warnings, (b: Boolean) => warnings = !b), ("-deprecation", () => deprecationWarnings, deprecationWarnings = _), ("-unchecked", () => uncheckedWarnings, uncheckedWarnings = _), @@ -117,6 +119,7 @@ class ScalaCompilerSettings(state: ScalaCompilerSettingsState) { higherKinds = state.higherKinds existentials = state.existentials macros = state.macros + experimental = state.experimental warnings = state.warnings deprecationWarnings = state.deprecationWarnings @@ -143,6 +146,7 @@ class ScalaCompilerSettings(state: ScalaCompilerSettingsState) { state.higherKinds = higherKinds state.existentials = existentials state.macros = macros + state.experimental = experimental state.warnings = warnings state.deprecationWarnings = deprecationWarnings diff --git a/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsPanel.form b/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsPanel.form index 7f443402bd2..305c77875b7 100644 --- a/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsPanel.form +++ b/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsPanel.form @@ -227,6 +227,14 @@ + + + + + + + + diff --git a/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsPanel.java b/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsPanel.java index 095955b3f05..69ea698a04b 100644 --- a/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsPanel.java +++ b/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsPanel.java @@ -37,6 +37,7 @@ public class ScalaCompilerSettingsPanel { private JCheckBox myFeatureWarnings; private JCheckBox myMacros; private JCheckBox mySpecialization; + private JCheckBox myExperimental; private MyPathEditor myPluginsEditor = new MyPathEditor(new FileChooserDescriptor(true, false, true, true, false, true)); @@ -61,6 +62,7 @@ public ScalaCompilerSettingsState getState() { state.higherKinds = myHigherKinds.isSelected(); state.existentials = myExistentials.isSelected(); state.macros = myMacros.isSelected(); + state.experimental = myExperimental.isSelected(); state.compileOrder = (CompileOrder) myCompileOrder.getSelectedItem(); state.warnings = myWarnings.isSelected(); @@ -97,6 +99,7 @@ public void setState(ScalaCompilerSettingsState state) { myHigherKinds.setSelected(state.higherKinds); myExistentials.setSelected(state.existentials); myMacros.setSelected(state.macros); + myExperimental.setSelected(state.experimental); myCompileOrder.setSelectedItem(state.compileOrder); myWarnings.setSelected(state.warnings); @@ -270,6 +273,11 @@ public void setProfile(ScalaCompilerSettingsProfile profile) { mySpecialization.setDisplayedMnemonicIndex(7); mySpecialization.setToolTipText("Respect @specialize annotations"); panel1.add(mySpecialization, new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + myExperimental = new JCheckBox(); + myExperimental.setText("Experimental"); + myExperimental.setMnemonic('X'); + myExperimental.setDisplayedMnemonicIndex(1); + panel1.add(myExperimental, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final TitledSeparator titledSeparator3 = new TitledSeparator(); titledSeparator3.setText("Compiler plugins"); myContentPanel.add(titledSeparator3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); diff --git a/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsState.java b/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsState.java index ba796f3a959..0b4a96d261d 100644 --- a/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsState.java +++ b/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerSettingsState.java @@ -27,6 +27,8 @@ public class ScalaCompilerSettingsState { public boolean macros = false; + public boolean experimental = false; + public boolean warnings = true; public boolean deprecationWarnings = false; @@ -67,6 +69,7 @@ public boolean equals(Object o) { higherKinds == that.higherKinds && existentials == that.existentials && macros == that.macros && + experimental == that.experimental && warnings == that.warnings && deprecationWarnings == that.deprecationWarnings && uncheckedWarnings == that.uncheckedWarnings &&