Have you ever wondered whether 1 to 3 is an inclusive or exclusive range? What about 1 until 3? Or Range(1, 3)? No need to worry – now the answer is clear:Īs always, we welcome your feedback. You can now autocomplete the applicable options and see quick documentation for each of them: Furthermore, those options vary depending on the Scala version in use. There are tons of different options in the Scala compiler, though very few programmers learn them all by heart. You can read our recent blog post for more details. The Scala plugin now supports data flow analysis, which can help you detect programming errors more easily: You can configure which version of Scala is used in cross-compiled projects at any time in Settings | Build Tools | sbt. Thus, opening a cross-compiled project as Scala 2 is technically more correct.
#Intellij plugin code#
If the IDE thinks that a project contains Scala 3, it may actually use Scala 3 features on editing, code generation, and refactoring, even though these features must not be used when compiling the code for Scala 2. It’s wise to use battle-tested and well-optimized implementations when working with Scala 2 code. There are many more IDE features that are necessary for Scala 3 but that are not optimal for Scala 2. Even if there are no Scala 3 features in those APIs, the IDE has to use Scala 3 algorithms. However, if you open the project in an IDE, there are a couple key differences. If you look at the scala3-cross.g8 template, you can see that crossScalaVersions includes both scala2Version and scala3Version, while scalaVersion is set to scala3Version Why does the default Scala version matter? If you only need to build the project, the default Scala version isn’t important. (Please don’t confuse cross-compiled projects with mixed Scala 3 / Scala 2 projects, where each module is either Scala 2 or Scala 3, but not both.) Opening such projects as Scala 2 allows the IDE to use the technically correct Scala version and is more reliable: Many projects that should be compiled for both Scala 2 and Scala 3 are modeled as Scala 3 projects cross-compiled for Scala 2, even though technically they are Scala 2 projects. We’d like to thank them for all the work they’ve done to improve the plugin! Open cross-compiled projects as Scala 2 While everyone in the IntelliJ Scala team has been focusing on Scala 3, we have attracted interns to implement other features, such as the Data Flow Analysis in this release or the Package Search Integration in the previous one. To do that, select Nightly builds in Settings | Languages | Scala | Updates | Channel (you can revert to an earlier build in the same place at any time). We’ve improved the resolution of given imports and implemented support for final top-level members and abstract lazy vals.īecause Scala 3 support is actively being developed, we recommend using the nightly plugin builds to benefit from the new improvements.There are more inspections that are compatible with Scala 3.The highlighting of lexer and parser errors is now significantly faster.The TASTy reader can now parse package objects, as well as variance and bounds in higher-kinded types.
Autocompletion is now provided for the given, using, and export keywords, soft keywords, and the quiet syntax.We’ve added highlighting, navigation, and autocompletion for end markers.Our main focus in this release has been Scala 3 support: Inlay hints for ranges Scala 3 support improvements Autocomplete for Scala compiler optionsĥ. Open cross-compiled projects as Scala 2Ĥ. There are also several new features to help with day-to-day Scala programming. This release brings more improvements to Scala 3 support. Autocomplete for Scala compiler options.Open cross-compiled projects as Scala 2.