Skip to content
Commits on Feb 14, 2014
  1. @dragos

    Package structure reorganisation.

    dragos committed
    This commit keeps all filenames unchanged, but builds a cleaner
    package structure of the IDE.
    There are only 5 top-level packages now:
    - core
    - ui
    - logger
    - util
    - refactoring
    Code is split in internal and API packages. Note that this commit
    only touches directories, and the API work (clean up, documentation,
    interfaces) will follow.
    The guideline was to keep related code together. The only exception is
     ui code, that is moved to its top-level package. Additional dimensions
     (for example, following Eclipse concepts like launchers or preferences
     would make it too hard to decide what goes where).
    Two unused files were removed:
    - JVMUtils
    - util/Colors.scala
    This organisation makes it easier to see duplicated functionality (like
    several RegionOps implicit classes). However, to keep things simple, that work is delayed to follow up PRs, so code changes can be independently 
    and easily reviewed.
Commits on Jan 8, 2014
  1. @dotta

    Removed special support for Scala continuations

    dotta committed
    The Scala IDE used to package the continuations plug-in to match the Scala
    distribution.  While this conveniency was appreciated by the few using
    continuations in their projects, it imposed a technical debt on the Scala IDE
    codebase (have a look at how the compiler `Settings` used to be instantiated).
    Recently, the continuations plug-in has been refactored and splitted into two
    separate JARs (a compiler plug-in, and a library). After this modularization,
    the Scala IDE codebase could no longer be compiled inside Eclipse because the
    continuations library isn't included in the project's classpath. Of course, we
    could implement a workaround to restore the functionality, but it just doesn't
    seem worth the time, considering the Scala Team has deprecated the
    continuations plug-in and will effectively drop supporting it the moment 2.12
    is released.  Hence, the decision of dropping the out-of-the-box support in the
    Scala IDE.
    From now on, if you want to use continutions in a project, you will have to
    provide the location of the continuations JAR via the -Xplugins setting.
    Finally, a couple of tests exercicing the behavior of both the presentation
    compiler and the build compiler when compiling a sourcefile that requires the
    continuations plug-in are now executed only for Scala 2.11 or later. This is
    needed because the continuations.jar is no longer loaded when starting the
    compiler inside Eclipse, and that turns out to affect semantic of programs
    using continuations in Scala 2.10, because the compiler does no longer report
    an error if a source file (requiring continuations) is compiled without passing
    the flag to enable the plugin. Why? Because up until Scala 2.10 the compilation
    error is reported by the continuations.jar (!!). Of course, that error cannot
    be reported if the continuations.jar isn't available anymore (which is the
    whole point of this commit).  The behavior with Scala 2.11 is different because
    the continuations library has been moved out of the scala library (see
    and hence a compilation error is reported whenever a source is compiled without
    the continuations library in the classpath. That explains why the tests are now
    only executed on 2.11+.
    This commit undos all changes related to supporting continuations made by
    @adriaanm in #604
    Fix #1002012
    Fix #1002011
Commits on Dec 11, 2013
  1. @adriaanm

    Catch up with Scala Library Modularization.

    adriaanm committed
    Split the dependencies along the scala-2.10.x and scala-2.11.x profiles.
    The goal is to evolve the 2.11 module structure to get a leaner set of
    dependencies on Scala Core, with a separate Scala Modules container.
    Support the 2.11 swing/continuations modules:
    Rename `continuations.jar` to `scala-continuations-plugin.jar`.
    In 2.10 this was called `continuations.jar`,
    in 2.11 it's `scala-continuations-plugin_2.11.jar`, and the library part
    is distributed separately, so add that to the Scala container.
    TODO: add scala-xml and scala-parser-combinators to the scala container and to the repl classpath
    (These dependencies should move to the Scala Modules container eventually.)
    Fix the outputDirectory-es of scala-(refactoring|swing)
    Plugin goes to lib/. Long live XML copy-paste reuse.
Commits on Oct 8, 2013
  1. @dotta

    Fixed race condition during presentation compiler restart

    dotta committed
    * In the former implementation, if a request to restart the presentation
      compiler was executed (concurrently) while the presentation compiler was being
      initialized, the reset request could get lost. This was the reason for
      flackyness of the hyperlinking test `HyperlinkDetectorTests.test1000656`.
      To prove this commit fixes the issue described above, I've reverted
      SHA: 35091ae.
    * This new implementation guarantes that:
      1) `askRestart` requests are never lost.
      2) If a call to `apply` is executed *after* an `askRestart` (by the same
         thread), the execution of the `apply` is guaranteed to be performed after
         the presentation compiler is reinitialized.
      In general, I believe it guarantees happens before semantic (see
    * Created a `ScalaPresentationCompilerProxy` that is responsible of handling
      the presentation compiler's lifecycle. Interestingly, this new abstraction
      allows for further refinements. For instance, it should be much simpler now to
      add the logic for automatically shutting down a presentation compiler when it is
      not being used for some time (the net effect would be to reduce the memory
      footprint when a user has several opened Scala projects).
    * Deleted `Cached` as it is now superseeded by `ScalaPresentationCompilerProxy`.
    * Never shutdown the presentation compiler in the middle of a test run. If you
      need to reinitialize the state of the presentation compiler, `askRestart`
      should be called instead of `shutdown`. The reason is that when calling
      `shutdown`, the presentation compiler dumps all queued work items, and this
      can lead to lost updates.
      On the other hand, for test isolation reasons, it is absolutely fine to shutdown
      the presentation compiler *before*/*after* a test is executed.
    * Deprecated `doWithPresentationCompiler` and `withPresentationCompiler` in
      ScalaProject. ScalaProject's methods `doWithPresentationCompiler` and
      `withPresentationCompiler` are superseeded by `presentationCompiler.apply`. The
      main reason for doing so is that I don't think it is useful to have ARM methods
      when the used resource is publicly accessible (i.e., the `presentationCompiler`
      While doing this refactoring, I noticed we need a 'null object' of a `Response`
      (look at `ScalaSourceFile.scheduleReconcile()`).  The only alternative to
      returning a 'null object' is to throw an exception, which I don't think is the
      right solution in this case. Unfortunately, creating a 'null object' for
      `Response` is currently cumbersome because `Response` is a concrete class, and
      not an interface. Hence, I'm deferring this further refactoring to a different
      pull request.
    * Changed `InteractiveCompilationUnit.withSourceFile` return type to `Option`.
      This was needed after deprecating `ScalaProject.defaultOrElse`. Moreover, it
      makes sense as it matches the signature of
      `ScalaPresentationCompilerProxy.apply`, which is the underlying method being
    Fixes #1001880
    Re #1001875
    Re #1001911
  2. @dotta

    Removed uneeded locking in `ScalaProject.failedCompilerInitialization`

    dotta committed
    The reason why we were using the instance locking was to avoid showing several
    times the message dialog that occurs when the presentation compiler fails to
    If you look closely, you will notice that the lock is simply used to make sure
    the update of the field `messageShowed` is atomic. Therefore, it is only
    natural to replace the lock usage with an `AtomicBoolean` which has very handy
    operation for atomically setting its content, and returning the old value.
Commits on Oct 2, 2013
  1. @huitseeker

    Merge pull request #553 from dragos/issue/builder-transitive-rebuilds…

    huitseeker committed
    Correctly build projects that depend through exported dependencies.
Commits on Sep 30, 2013
  1. @sschaef

    Clean up code base

    sschaef committed
    The new warnings of 2.11 made a great deal.
    - Removal of unused code
    - Change var to val when possible
    - Remove unused imports
  2. @dragos

    Correctly build projects that depend through exported dependencies.

    dragos committed
    The Scala builder optimised the case where the builder was triggered with
    no changes in a project, by skipping the call to the underlying Sbt builder.
    This is wrong when the project has no changes itself, but a dependent project has.
    Fixed #1001904.
    Consider for back porting to 3.0.x
Commits on Sep 12, 2013
  1. @dragos

    Reviewer's comment.

    dragos committed
  2. @dragos
  3. @dragos
  4. @dragos

    Fix source file caching in presentation compiler.

    dragos committed
    Removed the sourceFile map altogether. Caching is performed now at the
    level of `InteractiveCompilationUnit`, who may keep the last SourceFile
    instance. The default implementation does not cache anything, but
    `ScalaCompilationUnit` does.
    In the process, removed a number of `withSourceFile` methods on project
    and presentation compiler classes. These may break plugins.
    Fixed #1001859
Commits on Sep 5, 2013
  1. @skyluc

    Updates continuations option tests for 2.11

    skyluc committed
    In Scala 2.11, the continuation plugin is no more enabled by default when
    Two main changes:
    - forces enable the continuation plugin when running the tests on Scala 2.11
    - modifies the tests to use the project specific preferences, to avoid side effects
    of the configuration changes needed for the tests.
Commits on Sep 2, 2013
  1. @dragos

    Mark output folders as "Derived".

    dragos committed
    Derived folders won't appear in "Open Resource", polluting
    names with classfiles.
    Fixes #1000260 (which regressed at some point in time).
Commits on Jun 30, 2013
  1. @sschaef

    Solve deprecation warnings

    sschaef committed
Commits on Jun 24, 2013
  1. @huitseeker

    In the immortal words of @paulp:

    huitseeker committed
     "Can we please, please not do this:
      import PatternMatchingStats._
      import global.{phase, currentRun, Symbol,
        Apply, Bind, CaseDef, ClassInfoType, Ident, Literal, Match,
        Alternative, Constant, EmptyTree, Select, Star, This, Throw, Typed, UnApply, (...)"
    Let's simplify merges, by making our imports mono-line !
    Thanksfully, in the IDE, we don't do (many) *mutli-line* braced Imports, so it
    was enough to filter them with the following one-liner:
    for i in `find ./ -type f -name "*.scala"`; do perl -nle 'if (m/^(\s*)import\s([^\n]+?){([^}]*?)}$/smg){my ($s,$x,@y)=($1,$2,split /,\s*(?!_|\s)/,$3); foreach $dep (@y){$dep =~ s/^\s+|\s+$//g; $dep=($dep =~ m/=>/)?"{ $dep }":$dep;print "${s}import $x$dep";}} else {print $_;}' $i > $; mv $ $i; done
    Note the negative lookahead to avoind busting final wildcards in
    braced imports (see the Spec version 2.9, section 4.7), .
    If you want to do this on a repo that contains multi-line braced
    imports, look into unsetting the special variable '$/' of perl, and
    relax the condition on the presence of new lines in the second capture
    group of the regex above. I strongly advise against doing this
    automatically on such a repo, though.
    Fixes of multiline braced imports (manual).
    Let this be the end of this lazy, messy, mergepain-inducing practice.
    Fixing test relying on braced import.
Commits on May 31, 2013
  1. @dragos

    Use the configured JDK and Scala library when building.

    dragos committed
    Make sure the Sbt builder uses the configured JDK and
    Scala library. Make sure Sbt does not infer some default
    libraries for `-bootclasspath`, or the JDK used for running
    Fixed #1001387
  2. @sschaef

    Update of codebase to conform the rules of Scalastyle

    sschaef committed
    This commit contains:
    - Correction of tests that rely on trailing white spaces.
    - A fix of a package name in a test unit.
    - Removal of trailing white spaces and tabs in the whole project.
      The changes are all done automatically with the following
      (Conversion of tabs to white spaces)
      find . -iname "*.scala" -print0 | xargs -0 sed -i 's/\t/  /g'
      (Removal of trailing white spaces)
      find . -iname "*.scala" -print0 | xargs -0 sed -i 's/ *$//'
    - To is some content added to an empty Scala file to solve a
      Scalastyle warning.
Commits on May 13, 2013
  1. @dotta

    Only consider opened projects when computing a project's direct depen…

    dotta committed
    When computing a project's direct dependencies, filter out non opened
    projects (if a project is open it implies it exists, which is why there is no
    need to check for `project.exists`).
    Fix #1001714
Commits on Apr 30, 2013
  1. @dragos

    Don't force -Xprinttypes.

    dragos committed
    Fixed #1001677.
Commits on Apr 23, 2013
  1. @dragos @huitseeker

    Removed the Refined build manager.

    dragos committed with huitseeker
    Fixes #1001422
Commits on Apr 16, 2013
  1. @huitseeker

    Drops some 2.9 deprecations

    huitseeker committed
Commits on Mar 25, 2013
  1. @dragos

    Avoid workspace-wide locks when building.

    dragos committed
    There is no reason to lock the workspace when building a project. Markers already
    lock the required resources, and the build should just lock the current project.
    Fixed #1001631.
Commits on Feb 25, 2013
  1. @dotta

    Do not force default location of -XpluginsDir in Scala Compiler Prefe…

    dotta committed
    Trying to force the default location to the plugins directory containing the
    continuations.jar plugin turned out to be a very bad idea (this was done as
    part of commit SHA-cbfd82d874f998b7726fec895ad4d83194ad1e5b).
    The issue is that the default location where the continuations.jar is stored
    changes *each time a user updates the Scala IDE* and, when updating, the
    *former location is deleted*. The net effect of this is that after upgrading,
    all projects using the continuations plugin would report the following error
    	`bad option: -P:continuations:enable` is reported
    Simply because the continuations.jar can no longer be located.
    The fix is to somewhat restore the former implementation wrt how we handle the
    `-Xpluginsdir` compiler setting. Basically, the solution consists in not
    showing the default value of `-Xpluginsdir` to the user in the Preferences
    dialog, and pass this default to the different compiler instance we create
    unless the user specifices a different location (in which case, we do use the
    location provided by the user).
    There is one more catch due to the current way `ScalaProject.scalacArguments`
    is implemented (the method is used to pass the compiler arguments to the Sbt
    builder). In short, the returned arguments are only the ones forces by the user
    via the Preference dialog. Since the `-Xpluginsdir` default directory is
    **not** shown in the Preference dialog, the Sbt builder would fail to compiler
    projects with continuations enabled because it wouldn't know where to look for
    the continuations.jar. Hence, I had to add some ad-hoc code to handle this
    correctly in `ScalaProject.scalacArguments`.
    This whole fix is far from ideal, but I want to keep the changeset as small as
    possible to avoid regressions, since this commit should be included in the
    upcoming 3.0.0 release.
    By the way, all existing projects that were affected by the error should
    restore the defaults (Preferences > Scala > Compiler and hit the Restore
    Defaults button).
    Fixes #1001030, #1000700
Commits on Feb 11, 2013
  1. @dragos

    Initialize symbols for primitive types on compiler startup.

    dragos committed
    The nightly build uncovered a race condition in the indexer, that stepped on
    a case where `definitions.ShortClass` was not yet loaded, triggering the
    symbol loader.
    Needs back port. Should fix flaky presentation compiler tests.
Commits on Feb 7, 2013
  1. @dragos

    Merge pull request #297 from gzsombor/handle-exceptions-with-closed-p…

    dragos committed
    Add checks if the underlying project closed/not exists, and catch JavaMo...
  2. @gzsombor

    Add checks if the underlying project closed/not exists

    gzsombor committed
    There are scenarios, where project depends on other, closed projects -
    this happens with IvyDE, which adds even closed projects to the dependency
    list (of course, in that case, the generated jars added as well), but
    these closed projects cause build failures for ScalaIDE, because it
    doesn't expects that the underlying IJavaProject could throw exceptions.
    So the general fix is to add checks before calling the critical methods,
    and a catch block with logging.
     This fixes #1001465
Commits on Feb 5, 2013
  1. @dragos

    Rebuild Scala projects after a global compiler settings change.

    dragos committed
    If the user changes compiler settings on the Scala Preferences page, all Scala
    projects that 'inherit' these settings should be rebuild. The existing logic
    was dealing only with the case where *project-specific* settings were changed.
    Fixed #1001460.
Commits on Feb 4, 2013
  1. @dragos

    Remove `Xmigration28` setting.

    dragos committed
    Fixed build for 2.10.1-SNAPSHOT.
Commits on Jan 4, 2013
  1. @rkrzewski

    Fix #1001394 Ignore source classpath entries that don't exist physica…

    rkrzewski committed
    …lly in the workspace.
    m2e routinely adds optional CPEs for src/main/java, src/test/java even when
    the directories are missing. SBT builder is not aware that they are optional
    and aborts compilation.
Commits on Dec 4, 2012
  1. @dragos

    Correctly update project settings when the preferences change.

    dragos committed
    The `PropertyStore` class is a snapshot, and during the move to sbt 0.13 the storage
    became a lazy-val, meaning we started to lose project settings.
    Fixed #1001241
    Fixed #1001267
Commits on Sep 2, 2012
  1. @dragos
Commits on Aug 7, 2012
  1. @vigdorchik @dotta

    Use stock sbt 0.13 from eclipse

    vigdorchik committed with dotta
    * Move sbt to 2.9.2 for 2.9.x series.
    * Use short sbt.compiled.version for 2.10.x
    * Use full version of sbinary.
    * Fixed continuation plugin test: Continuations plugin is _not_ enabled by default in 2.10
Commits on Jul 27, 2012
  1. @dragos

    More abstract dealings with Scala compilation units.

    dragos committed
    We need a way to treat uniformly different kinds of Scala-based sources. Until now
    we routed everything through `ScalaCompilationUnit`, that extends the JDT `CompilationUnit`
    class. This tight connection is counter-productive, and in most cases, unnecessary.
    This commit is a step towards extracting a set of interfaces for other Scala-based
    sources to benefit of reconciliation ('errors-as-you-type'), hyperlinking and completion
    engine that already exists.
    * extracted `InteractiveCompilationUnit` as a super type of `ScalaCompilationUnit`
    * switched from `ScalaCompilationUnit` to `InteractiveCompilationUnit` wherever possible, to allow
    hyperlinking to work in the scala-worksheet project
    * added a utility method to retrieve the compilation unit associated with an open editor that
    uses the platform adapter protocol to allow other plugins to participate.
Commits on Jul 21, 2012
  1. @dragos

    Only react to part-closed events related to the current project.

    dragos committed
    This regression manifested by having a Scala compiler started on all Java projects when
    a file was closed. Annoyingly, that lead to the FailedCompilerInitialization window asking
    about adding the Scala library.
Something went wrong with that request. Please try again.