Is there a keyboard shortcut for adding type definitions to Scala declarations in IntelliJ ? I cannot find any. I can find the tooltip though, but a shortcut would be nicer.
Single-line comments in Java start with two forward slashes ( // ). To quickly add a line comment in IntelliJ IDEA, press ⌘ / on macOS or Ctrl + / on Windows and Linux.
In IntelliJ IDEA, you can identify the type of an expression in the following way: Place the caret at the necessary code element and press Ctrl+Shift+P (or select View | Type Info from the main menu).
On the Project pane on the left, right-click src and select New => Scala class. If you don't see Scala class, right-click on HelloWorld and click on Add Framework Support…, select Scala and proceed. If you see Error: library is not specified, you can either click download button, or select the library path manually.
Unfortunately, no. The best option is as @pamu explained. Move your cursor to the variable or function declaration, type ALT+ENTER, and select "Add type annotation to definition" in the menu. You can still avoid the mouse by navigating with the down arrow and selecting with enter.
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