Using IntelliJ in Scala Project

So I have a multi Module, cross platform project. Currently I build with Mill and SBT. I run Mill as my main workhorse, but there’s still some tasks that I haven’t created for Mill. I edit in Eclipse. The Eclipse workspace and the individual projects lie outside the project directory. All the Eclipse projects use manually created source links.

This is rather messy, took time to set up, but currently works well for me. However I want to make my project accessible to beginners, even people with no Scala experience. Plus Scala-IDE can not be relied upon for 2.13. So I’m looking to move to IntelliJ.

I’ve tried creating IntelliJ - sbt projects in various ways, but they never seem to function correctly. The Sbt build file has a number of sub projects just to create different JavaScript artefacts and sub projects for aggregation. So I’m not sure that the import / creation feature works for complex non standard builds. The other disadvantage of IntelliJ-sbt projects, as I understand it is that they need to be recreated, every time the build is modified.

So I was thinking of creating the IntelliJ project manually in the project directory but whitelisting certain IntelliJ configuration files in the .gitignore. Any thoughts advice appreciated.

There is no need to “recreate” IntelliJ-SBT projects. You can set IntelliJ to automatically reload when the build file changes, or to reload only when you tell it to. If you did not set it to automatic and change the build file, IntelliJ will notify you that the build file has changed and should be reloaded, and it will offer you to set it to automatic reload.

I created a simple project with a debug macros module and a main module. It works through the sbt shell, but doesn’t recognise the macro if I try and build it directly. The sbt shell allows you to go to errors, but doesn’t provide any of the other facilities of an IDE.

See http://www.lihaoyi.com/mill/#intellij-support

I have tried that in the past, but it didn’t seem to be working properly. I seem to recall some indication on the Gitter channel that the feature required work. My main problem with IntelliJ at the moment seems to be macros. I only use them to provide source code positions for my debugging print outs. But I do find them fairly essential, otherwise I spend ages trying to track down some forgotten println.