scala-ide/scala-ide — pull request #69 by dotta (2012-02-17 14:19:40+00:00)
Title: Override default when an explicit value is provided for `-XpluginsDir`.

In the IDE, for convenience we use to se the value of `-XpluginDir` to the
default location in the distribution that contains the continuations.jar
plugin. This is convenient because users need only to pass
`-P:continuations:enable` to use the continuations plugin.

If in the IDE an explicit value is provided for `-XpluginsDir`, then we simply
concatenate the user's provided plugins' directory to the default one. This
generally works fine and allows users to keep using the continuations plugin
without having to copy the continuations.jar in the provided user's plugin
directory.

However, by passing the additional parameter -Xplugin
${path-to-continuations-plugin}, the compiler is unable to load the
continuations.jar. The reason is that there is ambiguity. `-XpluginsDir`
instructs the compiler to load all plugins available in the passed
directory(ies) and, as we said in the first paragraph, that means that the
continuations' plugin gets always loaded. Now, when also `-Xplugin
${path-to-continuations-plugin}` the Scala compiler seems to get lost because
it sees the continuations.jar twice, and it looks like it decided to simply not
load it. Hence, the compiler will complain that the continuations plugin isn't
enabled. That looks like a bug, and a ticket in the Scala compiler JIRA has
been created for this: https://issues.scala-lang.org/browse/SI-5491.

But in consideration of what has been said, I believe that we should not try to
always set `-XpluginsDir` to point to the default location in the distribution.
If the user decides that it should point to some other place, then provided
location should be used. That actually matches the Scala compiler's behavior.

Fix #1000908.