Is there a way to run a Scala application or unit test within the Scala IDE 2.0.2 (Eclipse 3.7) if there are (unrelated!) compilation errors in the project?
In Java, this is no problem, but Scala IDE keeps telling me:
Project contains compilation errors (therefore, no binaries have been produced).
All I want to do is to run a small test during a major refactoring process, but I can't fix all compilation errors right now. And I don't want to start commenting things out, as those compilation errors are good reminders of tasks that still need to be done.
Once you have installed and generated the Eclipse project files using one of the above plug-ins, start Eclipse. Use File → Import → General/Existing Project into Workspace. Select the directory containing your project as root directory, select the project and hit Finish. And Voila.
Intellij is by far the best I have used. IntelliJ works well. However, it does choke on some of the functional libraries like cats (false highlighting). …it works in scalac, and in Eclipse/Scala-IDE.
Scala IDE. The Scala IDE for Eclipse is centered around seamless integration with the Eclipse Java tools, providing many of the features Eclipse users have come to expect including, Support for mixed ...
Currently the Scala IDE does not support this behavior, but it would be nice if it could.
To be aware of this, I created a ticket:
JDT allows to execute Java code despite of compilation problems in the sources. Internally JDT replaces the defective code with an exception, which is thrown if the relevant code is executed. But if the defective code is never called during execution, nothing bad happens. It would be nice if SDT supports similar behavior.
If you are using Scala 2.10, a good option is to use the newly introduced ???
notation. This way your code will compile even if the function is not yet implemented.
There is certainly a better way but this one will still be better than commenting code.
As suggested by Jesper, you can still implement ???
if you are working with previous versions of Scala:
def ??? : Nothing = throw new Error("Not implemented")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With