![]() ![]() ![]() We recommend that you choose the sbt-based project right from the start. You would need to add the build.sbt file to your project, describe your whole project inside build.sbt and then re-import the project. How do I migrate an IDEA-based Scala project to the sbt project? To fix Out Of Memory issues with the Scala compiler, increase the heap size in the JVM maximum heap size field of the Scala compiler server settings located in File | Settings | Languages & Frameworks. How do I resolve OutOfMemory exceptions when I compile my Scala project? ![]() We recommend that you switch to Java 8 SDK since the Scala version 2.12, and sbt versions 1.10 and later are not compatible with older Java SDK versions. In JVM SDK field specify the appropriate SDK. Press Ctrl+Alt+S to open Settings dialog.įrom the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server. In most cases your project JDK is not compatible with Scala or sbt version, try to change the Scala Compile Server SDK. Why am I unable to compile my Scala project? We also recommend that you use unique names for private methods in value classes. Why do I get Assertion error when I use the Make Project command?Ĭhange the Scala version to 2.12 and later. class files are generated), the highlighted code does not come with quickfixes proposals, it is not optimized for on-the-fly editing, and requires full compilation of the project, which means it might not work for incomplete code. Compiler-based highlighting is slower, it requires more resources (type checking is done twice. However, before that, think about possible drawbacks. Go to Settings | Languages & Frameworks | Scala and on the Editor tab switch the error highlighting to Compiler. If a lot of code is highlighted incorrectly, consider enabling Compiler-based highlighting. Use the same shortcut to enable the highlighting. If the highlighting level is set to None, then the type-aware highlighting will also be disabled. The type-aware highlighting is enabled in your project by default. Select the / * _ * /./ * _ * / option from the list. Highlight the code and on the main menu select Code | Surround With. If the type-aware highlighting highlights the correct code, and it's an error that happens rarely, try to disable the highlighting locally. If the above doesn't work then, first, create a ticket for us. If you find a ticket describing an issue similar to yours, and it's fixed, but not yet released on the Public update channel, you may consider switching to the Nightly update channel. You may also look through our list of open and fixed tickets on our YouTrack. It is possible that you experience an issue that was already reported and fixed. Try to update IntelliJ IDEA & the Scala plugin. The type checker might need time to catch up, and occassionally it might fail. Typically this happens when the code is complex and/or you just made an important modification. However, it also means that sometimes the results of the Scala plugin type checking differs from the Scala compiler - and that's a bug. Its logic is independent from the Scala compiler so that it can work with incomplete code and doesn't require prior compilation. The type checking is optimized for editing rather than compiling code. The Scala plugin uses its own type checker and performs its own type inference in real time, while you type your code. Check the following answers on most common scala/sbt questions that can help you solve compiler, performance or code highlighting issues you might come across while working with your project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |