I’m neither a Scala nor an Eclipse expert but I work with both for years, having built a significant amount of stuff on top of them. Since 2020-09, Eclipse requires Java 11+ and I discovered that the Scala-IDE I was using (and that is not maintained anymore) cannot work in this environment.
I’ve tried to install Scala Metal. It does the job for the source code authoring but I struggle in finding a way to setup a compiler. I’ve looked the web for guidelines or tutorials but I didn’t find anything really useful so far.
Looks like Eclipse is not that “trendy” anymore, is it? To some extent, I can understand it because this is really a complex and hard to master environment. However, I don’t think there is anything equivalent as of today. In any case, I have a legacy that I would like not to loose.
You’ll find a lot of Eclipse users are now probably using IntelliJ IDEA – the Leading Java and Kotlin IDE. For a full blown batteries included IDE and good Java / Scala interop, you can’t beat it. With that being said, Metals is also a popular option. We actually do have an Eclipse plugin, GitHub - scalameta/metals-eclipse: Eclipse Scala LSP plugin for Metals (WIP), but to be honest it’s also not actively maintained. We just don’t have the users or the contributors to keep it alive. The VS Code extension is by far the most popular way to use Metals.
I’ve tried to install Scala Metal. It does the job for the source code authoring but I struggle in finding a way to setup a compiler. I’ve looked the web for guidelines or tutorials but I didn’t find anything really useful so far.
I have no doubt that IntelliJ is a very good solution for developing with Scala. The point is that the Scala code is only one part of the whole which includes code generation for UML model and model-to-model transformations. This requires additional tools that I have to connect and to manage together as an integrated “tool chain”. This is where Eclipse has no competitor today, as far as I know.
Regarding the issues with the compiler, the point is just to integrate one - together with the build tool - in Eclipse. As I explain in my initial message I’m not an Eclipse specialist. With Scala-IDE you just had to install the plugin and everything was working. Without it, I have to do it “manually” but I don’t know how to proceed.
I think I misread your initial question assuming you wanted an alternative to Eclipse Scala-IDE and missed that you wanted to stay in Eclipse. Apart from the Metals Eclipse plugin, there isn’t any alternatives in Eclipse for Scala.
So, has anyone tried (and succeed!) to setup a full workable Scala development platform (i.e. with compiler and build tool) based on Eclipse 2020-09 or higher (i.e. Java 11+) ?
AFAIK IntelliJ is the de facto “standard” IDE in Scala community. There are also people who has VSCode/Vim/Emacs/any editor + Metals but that takes more patience to setup
scala IDE (that supports scala2.12) to get an update to run on Java 11+ and support on continuous build eclipse. The dependency of the scala integration on 1.8 is the main blocker for running on continuous build.
eclipse metals to get revived or recreated and implemented supporting scala 2.13+. (The metals group project didn’t understand or have any deep interest in the eclipse IDE and pivoted to integrations with simple editors)
currently I use Theia (after trying out VS and a few others) and even with the "eclipse shortcut " plugins its a far cry to being the rich IDE that eclipse is.
I used Eclipse to develop Scala applications between Scala 2.7 and I think 2.11 and have to say, no other solution was so well integrated, especially for polyglot projects. Nowadays, there are workflows that also give fast results, but the Eclipse concept of instant compilation such that you see the full impact of a single change in a whole project is unbeaten. The price was a rather low-level coupling to Eclipse internals. Unfortunately, Scala-IDE developers did not wrote an Scala Editor from the building blocks but decided to patch and adapt the existing Java support, which was a ticking bomb, so to speak, as there were so many unstable internals to touch and they needed to use AspectJ for the patching, raising the complexity again. Therefore it’s technically extremely difficult or rather impossible to keep the old Scala IDE running in a newer Eclipse runtime.
Beside the (currently) discontinued metals-eclipse project, there is no project I’m aware of, that natively integrates Scala into Eclipse. A large portion of the Eclipse conveniences come from the tight integration of the tools/compilers into the Eclipse event bus, such that depending modules can act on events like recompilations or refactorings. The Build Server Protocol (BSP) is probably the best way to adapt an IDE to a build tool in a generic way. So I think, if Eclipse would get BSP support, it would be immediately usable for a large user base again. Without that, it’s unrealistic to hope for any Eclipse-based Scala IDE revival.
Am I the only one to see this as an heresy? It is a shame that nobody could come up with an API to allow Java based languages and IDEs to communicate through the JVM. Calls to web services are way heavier. It is even possible that initially those were invented to solve communication problem between Java and Microsoft technologies, not long after the Sun/Microsoft conflict about 100% pure Java, after which M$ decided to drop Java and create its own parody of it (.net), forcing everybody on the planet to go with network protocols where either API calls or RMI should should have made the job. My next rant will be about Javascript but enough for now.
The problem is that BSP allows an IDE to talk to one build tool, but that does not help in a multi-language project, which becomes the norm in general, and more specifically as Scala is a multi-platform language. That does not even work properly for languages on the same platform, like mixed Scala and Java projects. As for example a Java LSP server that provides code intelligence for Java files in a project would likely need to talk to a Scala BSP server, but should not be required to know about Scala specific things and the Scala part of the build.
To make that work a BSP server would need to present different “project facets” to different LSP servers.
At this point it’s actually funny to recognize that Eclipse had already solutions for all such things 20 years ago. It has actually a concept of “project facets”… Eclipse was such a superior architecture. It’s a shame they never managed to build some good, simple UI on top. But OK, this ship likely sailed.
As the idea behind a BSP server is actually similar to the idea behind LSP, where you have one LSP / BSP server for one backend tooling, one would actually even need some kind of “meta BSP server” which talks to all the build tooling specific BSP servers (think build tools for other languages like JS / TS, C, C++, Rust, what you have), and the IDE would only talk to such a “meta BSP server”.
But all this does not exist currently. There are ad hoc solutions hard coded into some IDEs (like e.g. for HTML and JS). But that’s not optimal, and does not really scale to all kinds of combinations of languages. If I for example use Scala Native I would like to be able to jump to extern definitions in C/C++/Rust directly from Scala code (and back). Or say I want to call some Scala.js code from TS files, IDE support should be still seamless. All that in the same project. But for that to work build tooling would need to be able to “talk to each other”, and be able to integrate with the other “project facets”. So some “coordinator” on top would be needed.
If you have already a “meta build system” (something like Bazel or Buck) it could act directly a the “meta BSP server”. Still it would need to present different “project facets” to different clients. This is not specified.
I wouldn’t mind hearing whether anything has changed in the four years since this topic was opened.
Have the primitive folk who posted way back then developed any new tooling that integrates with sticks and stones?
Does IntelliJ IDEA - the Leading Java and Kotlin IDE now call itself IntelliJ IDEA - the Leading Java and Kotlin and Scala IDE?
One twist for polyglot support would be interop support. Can scalac understand my Java source and also ingest my precompiled Java classes; and conversely is my Scala visible and usable from Java.
For that matter, do my Scala sources compile correctly under “separate compilation”?
Another example value-added feature is multi-version support, where a class might be “versioned” under scala-3, or a subproject, or even a v3 git branch. Maybe there is experimental support for the ifdef plugin.
Also I shouldn’t have to leave the IDE to update my unit tests that assert conditions using embedded literals. Don’t even ask me to git diff.