JetBrains

IntelliJ Scala Plugin 2022.1 Is Out!

Features Releases This release has been focused on improving Scala 3 support. There are also several new features to help with day-to-day Scala programming. Let’s take a closer look: 1. Scala 3 support improvements2. New Scala project wizard3. Alias exports4. Unused declaration inspection5. Scala debugger upgrades Scala 3 support improvements This release includes many Scala 3 support improvements: It is now possible to autocomplete extension methods (to see methods from other objects, press Ctrl+Alt+Space twice). The editor offers to import extension methods and given instances automatically. New inspections for the infix modifier and @targetName annotation can help you maintain a consistent code style. We’ve significantly improved the performance of the .tasty reader, so indexing Scala 3 libraries is now up to twice as fast. New Scala project wizard Configuring a new Scala project just got easier! With the updated New Project wizard, you can select a JDK, desired build system, and Scala version for your project in a single step: Alias exports Most things in Scala are aliases, including String, Seq, List, Set, and Map. This affects syntax highlighting, GoTo, Quick Documentation, Quick Definition, Find Usages, Optimize Imports, and other IDE features, because they act on aliases rather than actual definitions. To improve the user experience, the editor now treats aliases in the standard library as transparent exports, so, for example, List implies scala.collection.immutable.List rather than scala.List: Unused declaration inspection Previously, the detection of unused declarations was limited to private bindings. Now the Unused declaration inspection supports public bindings introduced by classes, methods, variables, parameters, and so on: Currently, this functionality has to be enabled in the inspection settings (Settings | Editor | Inspections | Scala | General | Unused declaration), but we will enable the feature by default in the bug-fix release. Scala debugger upgrades In this release, we’ve made an effort to revamp and streamline the Scala debugger. We’ve upgraded the handling of objects, primary constructor parameters, value classes, Arrays, lazy vals, and collections, in addition to improving expression evaluation: As always, your feedback is very welcome. Please report any issues you find to YouTrack. If you have any questions, feel free to ask us on Discord. Happy developing! The IntelliJ Scala plugin team

Read More

C++ Annotated March 2022: Function vs. Type, Serialization in C++, DWCAS, C++ Modules in Visual Studio

News We have all of the March news for you in our latest monthly C++ Annotated digest. Read the monthly digest on our blog and subscribe to C++ Annotated emails by filling out this form. Language news C++ Committee news February’s virtual plenary was the official feature freeze date for C++. Since then, it has become noticeably quieter around the C++ Standards Committee. During the last couple of months, the Library Evolution Study Group has been working on various fixes to existing language features that have been improved for C++23, such as ranges and formatting. They’ve also been polishing the API of new features already accepted for C++23, in particular mdspan, which is now looking really good. The Language Evolution Study Group is similarly focused on various smaller bug fixes for language features. We now also definitely know that we will not be getting executors or networking in C++23, two of the four items that were originally prioritized for C++23 according to the “overall plan for C++23” proposal. The three language features mentioned in that plan (reflection, pattern matching and contracts) are also nowhere near ready yet. As a result, the largest core language feature that is actually going to land in C++23 is deducing this. C++23 was never going to be as large a release as C++20 was, but it also seems that the pandemic and the need to move all standardization work from in-person to online meetings significantly hampered progress. During the last couple of months, I (Timur) was mostly active in the Core study group that finalizes the wording for language features, where my paper on portable assumptions is now in the final stages of wording review. I am firmly expecting that it will be voted into C++23 at the next plenary session. I also participated in the Contracts study group (SG21), which is currently rather stuck on the question of whether or not the expressions inside a contract annotation should be allowed to have side effects, and what exactly would happen if they did. Various opinions exist, and it will take more work before we reach a consensus and can formulate a specification, but hopefully this will happen in time for C++26. The current state of this work is now being tracked in the newly established Contracts Working Paper. Expect the standard committee work to remain relatively quiet for the next few months. We are now finalizing all outstanding fixes for the July 2022 online plenary session. This is where we will finalize the C++23 wording for the committee draft, which then goes out for review by the individual national bodies. Learning SFINAE, overload resolution, and a surprising error A new blog post at C++ stories highlights an interesting aspect of SFINAE. The sample used in the article performs the basic operation of printing a tuple via the stream output operator. The custom operator throws a surprising compiler error when printing of the ‘n’ symbol is called. And even more surprisingly, the code doesn’t work for std::tuple_size_v but works when using std::tuple_size::value inside the implementation. The author digs deeper into the reasons why std::tuple_size_v doesn’t work for TupleT=char. An interesting discovery here is that the immediate context matters. While the compiler recognizes immediately whether std::tuple_size::value is valid or not, in the case of std::tuple_size_v it has […]

Read More