Intellij does not open Scala files - scala

I'm using IntelliJ (version 13.0) and Scala (2.9.1).
I created a Test project but Intellij does not open/display the scala files in the editor window. It displays the files only when I select the option 'Mark as Plain text' from the context menu of the scala file.

You need to install a separate plugin for Scala support: Scala plugin. This is also available directly from within IntelliJ IDEA using Preferences -> Plugins -> Jetbrains Plugins
More details about IDEA's Scala support are given here: The Most Intelligent IDE for Scala Development
Next, you need to add the Scala SDK to IntelliJ IDEA, again using the Project Structure -> SDKs. Finally add the Scala Facet to your module using Project Structure -> Facets.
A step-by-step check-list is given here: Getting Started with IntelliJ IDEA Scala Plugin. It's a bit out-of-date, but still covers all the steps.

Related

IntelliIdea - Cannot see scala in add framework support

I want to run scala code in IntelliJ Idea.
I donot see option scala in Add Framework Support
Please suggest how to do it?
To run the Scala code there is no need to add any framework or facet (things like this were done in some previous IntelliJ versions, but this is long ago).
The only thing you need is to install a Scala plugin.
If you did not install the plugin when installing the IDE, use menu item Settings, click on Plugin, then Marketplace and type Scala.
With a Scala plugin installed, you can create a new Scala project.

Intellij IDEA - Cannot add framework support for Scala

I have sbt 0.13.16 and Scala 2.10.6 running with Intellij 2018.2.1, working with those recommended sbt and Scala settings for Odersky's coursera course on Scala (I'm guessing their automated submission grader depended on old SBT?).
When creating new sbt + scala projects, I choose the above sbt and Scala versions, then after all the dependencies have downloaded, when I right-click New -> ... I see options for Java class but nothing for Scala. I have the Scala plugin already there according to the plugin settings.
So I try to Add Framework Support after right-clicking on the project, I select Scala, but then everything is disabled except Cancel.
I looked through previous forums, found one but that seemed relevant only for git projects.
Anyone else run into this issue? Do I need to update to more recent Scala and SBT? Any help would be very appreciated.
Please check https://plugins.jetbrains.com/plugin/1347-scala/versions for a compatibility table.
You can manage plugins in IntelliJ Preferences. Your versions seem to be too old to still be supported, already. It may help to upgrade IntelliJ and then go to preferences and get the latest Scala and SBT plugins.

How to use existing Scala with Intellij

I already have brew install scala - I am able to run Scala via command line. After that I installed IntelliJ version 2016.1.3
While installation process of IntelliJ, I was asked to install Scala plugin but i clicked no - because I already have Scala installed
Now I am trying to figure out where exactly we can create a Scala application with the use of my existing Scala installed. How and where in the IntelliJ can I set this up? I can only see Java projects available to be created.
Thanks
You can't. The Scala you have installed is a completely different thing from the IDEA Scala plugin.
The Scala plugin is what you need to handle Scala projects, editing Scala files, etc. in IDEA. The command-line Scala is just the compiler and the standard library, it doesn't know anything about IDEA.
Also, for the command line you should install SBT instead of working directly with the Scala compiler unless you want to handle dependencies, classpaths, etc. manually (you don't).
If you want to create Scala application using IntelliJ IDEA, you will need to install the Scala Plugin.
Step 1: Open IntelliJ Preferences or Settings
On Mac:
Open IntelliJ IDEA.
Then click on the menu item IntelliJ IDEA and select Preferences.
On Windows:
Open IntelliJ IDEA.
On the bottom right corner of the Welcome to IntelliJ screen, select Configure.
Step 2: Find and install Scala Plugin
After opening the Preferences or Settings screen from Step 1, click on the Plugins section on the left panel.
Then click on the Install JetBrains plugin… button.
This opens another window which has a Search box on the top left corner. Type in Scala in the search box and this will list the Scala plugin which you need to install.
Hit the Install button to kick off the installation.
Do not forget to Restart IntelliJ following the install.
And Voila! You should now be able to create Scala projects in IntelliJ.
For further instructions on how to install Scala plugin in IntelliJ, you can follow the instructions from www.allaboutscala.com

How to create a Play project in IntelliJ IDEA 14 Community Edition?

I am trying to create a Scala project in IntelliJ IDEA 14. As mentioned in IntelliJ IDEA's help, the Scala plugin already has support for Play 2.x.
I have installed the Scala plugin, and when I create a new project I can select Scala > Scala and Scala > SBT projects but there's no Scala > Play 2.x.
Are there any additional steps needed to make this available? I am using IDEA 14 Community Edition.
I have tried importing module to a Scala project using play-generated .impl file but IDE could not handle it well e.g. was finding errors in completely fine play! views.
Play framework is supported only in ultimate edition of Intellij Idea.
Here https://www.jetbrains.com/idea/features/editions_comparison_matrix.html, section Frameworks and Technologies.
For everyone else looking for an answer for Play 2.4+ the easiest way to get up and running is:
Create a new Run Configuration – From the main menu, select Run -> Edit Configurations
Click on the + to add a new configuration
From the list of configurations, choose “SBT Task”
In the “tasks” input box, simply put “run”
Apply changes and select OK.
Now you can choose “Run” from the main Run menu and run your application
https://www.playframework.com/documentation/2.4.x/IDE

How to generate Scaladocs from Eclipse project

I want to start generating scaladocs from my Eclipse project. I don't use SBT, but am willing to import my eclipse project to sbt if it is needed.
How do I generate Scaladocs from an eclipse Scala project?
As far as I know, there is no direct method supported by the Scala plugin for Eclipse without using SBT or Maven.
As a workaround, you can go to Run -> External Tools -> External Tools Configurations... and setup the scaladoc tool there as a Program. This way you would have a one-click solution for generating Scaladocs.