Warning

:!: Information on this page ist outdated. The plugin referenced on www.scala-lang.org is still in development and up to date.

http://www.scala-lang.org/node/1593

Old vs New plugin

There have been two plugins for editing Scala with Eclipse. The original plugin (listed at the main web page http://www.scala-lang.org/tools/eclipse/index.html is no longer actively developed, and whilst it’s been updated to use Scala 2.7, it has lagged behind.

The new plugin, described below,is the version of Eclipse that will be actively developed going forwards. It’s still a little rough round the edges (2008Q1) but is getting more stable as time goes on.

New Plugin

The new Scala Eclipse plugin is available for testing. It is available at http://www.scala-lang.org/downloads/distrib/files/nightly/scala.update/ as a remote update site. This update site is hooked directly into the nightly build, so bug fixes will be deployed rapidly. The design is very risky, so we expect many bugs at the beginning. Please field detailed bug reports through the Scala Trac, and use this page for release notes. For email discussion, use scala-tools@listes.epfl.ch. This page is owned by the community: feel free to edit this page with any useful information about the new plugin.

New features

  • Content assist that actually works.
  • Interactive/incremental type checking.
  • Better integration with Java.
  • Inter-project dependency tracking in incremental builder.
  • Supports the old plugin project file format, so you don’t need to migrate your projects to the new plugin.
  • Lots of little fixes and feature enhancements, too numerous to list now.

Issues

  • On many machines and definitely most 64-bit OS machines, you need to increase the amount of stack memory (and probably heap memory also) that you give Eclipse. Edit your eclipse.ini file with something like -showsplash org.eclipse.platform –launcher.XXMaxPermSize256m -vmargs -Xms40m -Xmx256m Different platforms may vary.
  • May need to disable or uninstall the old plugin before installing the new plugin. I was actually able to install over the old plugin just fine, but if weird things happen try disabling the old one.
  • Slow startup; there are just too many classfiles to load.
  • XML is not really supported. Surrounding your XML blocks by parens like (<foo>..</foo>) is supposed to work but is not well tested.
  • Case classes cannot coexist with companion objects yet; you’ll get a lot of weird errors, content assist won’t work very well.
  • No folding. I just couldn’t work with the Eclipse folder, its too flaky with respect to how the plugin managers the text buffer.

Wishlist

  • Code navigation :
    1. Ctrl+Shift+T ⇒ Goto class / trait / object
    2. F3 / ctrl+LMB ⇒ Goto definition
    3. Ctrl-O ⇒ Show overview of members
  • Small refactorings like local variable name change
  • Rename and move refactorings
  • Indent region
  • Showing javadoc from Java sources on mouse hover (the way Eclipse JDT does it). [already works, make sure your javadoc attachments are set correctly for your Java libraries - Sean]
  • Displaying Javadoc (and also Scaladoc?) documentation
    1. Shift+F2 ⇒ View Javadoc in an external browser
  • Outline View
  • Quick fix (ctrl-1) to create a missing trait/class/object or method
  • Show all references of trait/class/object/method, like JDT Refernces → Workspace etc
  • Toggle comment
  • Interactive shell from plug-in using project classpath
  • Interpreter mode
  • Mixed mode projects (Java and Scala). Not even sure that scalac supports this fully (can we have circular deps between Scala and Java?), but it should at least be possible to have scala sources mixed with Java sharing the same CLASSPATH as long as there’s a very clear order as to which gets compiled first.
  • Better support for Scala projects which depend on Java projects
    • “Goto definition” in Scala source when that definition occurred in Java files.

Bug reporting

Please leave detailed bug reports on how a defect occurs. Code is often not good enough, explain how the crash can be reproduce. Include error log entries as appropriate. Also, rate your bugs according to how annoying they are; e.g., is it just an entry in the error log or is it something that freezes you out of doing useful work. I’m aiming to fix the really annoying bugs first, other bugs will be fixed later.

The Scala Trac can be used for bug reports. Set “component” to “eclipse plugin” and please mention that it is about the “new plugin” in the summary or the comment.

FAQ

  • How come this plugin doesn’t seem to work at all?

You may be using the old (”stable”) Eclipse plugin which will soon be deprecated. The new (”beta”) Eclipse plugin seems to work much better. Make sure you are using the new plugin, which is available here http://www.scala-lang.org/downloads/distrib/files/nightly/scala.update/

  • Which versions of Eclipse are compatible with the new plugin?

I believe that Sean McDirmid has indicated the new plugin should work with versions 3.3 and 3.4 of Eclipse.

  • Does the plugin provide a built in Scala interpreter?

There is currently no interpreter supported in the new plugin. As a work-around, you can download the main Scala package, and launch the Scala interpreter using this command

  scala -classpath {your_eclipse_workspace}/{your_eclipse_project}/bin
  • Error opening a Scala file ‘class scala.reflect.Manifest not found’

Remove scala-library.jar from your .classpath or replace it with the scala-library.jar from the plugin. Note, if you use maven-eclipse plugin to generate the .classpath file you need to add following configuration:

  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-eclipse-plugin</artifactId>
      <version>2.5</version>
      <configuration>
        <excludes>
          <exclude>org.scala-lang:scala-library</exclude>
        </excludes>
        <classpathContainers>
          <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
        </classpathContainers>
        <projectnatures>
          <java.lang.String>ch.epfl.lamp.sdt.core.scalanature</java.lang.String>
          <java.lang.String>org.eclipse.jdt.core.javanature</java.lang.String>
        </projectnatures>
        <buildcommands>
          <java.lang.String>ch.epfl.lamp.sdt.core.scalabuilder</java.lang.String>
        </buildcommands>
      </configuration>
    </plugin>
  </plugins>
 
tools/eclipse.txt · Last modified: 2010/02/11 09:10
 
Recent changes RSS feed Valid XHTML 1.0 Driven by DokuWiki