Skip to content
Browse files

Merge pull request #198 from skyluc/issue/invalid-companions-exceptio…

…n-1001243

Added support for code specific to 2.9 or 2.10
  • Loading branch information...
2 parents 6bd9a57 + c4e3088 commit d63544190674618b54cfb2d9a708ba23e1f8b28d @skyluc skyluc committed Sep 10, 2012
View
1 org.scala-ide.sdt.core/.classpath
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src"/>
+ <classpathentry kind="src" path="src-2.9"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_COMPILER_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
View
17 org.scala-ide.sdt.core/pom.xml
@@ -83,6 +83,23 @@
</execution>
</executions>
</plugin>
+ <!-- added source folder containing the code specific to the scala version -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals><goal>add-source</goal></goals>
+ <configuration>
+ <sources>
+ <source>src-${scala.major.minor.version}</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
View
17 org.scala-ide.sdt.core/src-2.10/scala/tools/eclipse/SymbolsCompatibility.scala
@@ -0,0 +1,17 @@
+package scala.tools.eclipse
+
+import scala.reflect.internal.Symbols
+
+/**
+ * Trait used to keep 2.9-2.10 source compatibility
+ */
+trait SymbolsCompatibility { self: Symbols =>
+
+ /**
+ * This class as been removed in 2.10, but we need its real implementation in 2.9
+ */
+ case class InvalidCompanions(sym1: Symbol, sym2: Symbol) extends Throwable {
+
+ }
+
+}
View
10 org.scala-ide.sdt.core/src-2.9/scala/tools/eclipse/SymbolsCompatibility.scala
@@ -0,0 +1,10 @@
+package scala.tools.eclipse
+
+import scala.tools.nsc.symtab.Symbols
+
+/**
+ * Trait used to keep 2.9-2.10 source compatibility
+ */
+trait SymbolsCompatibility { self: Symbols =>
+
+}
View
3 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaPresentationCompiler.scala
@@ -41,7 +41,8 @@ class ScalaPresentationCompiler(project: ScalaProject, settings: Settings)
with JavaSig
with JVMUtils
with LocateSymbol
- with HasLogger { self =>
+ with HasLogger
+ with SymbolsCompatibility { self =>
def presentationReporter = reporter.asInstanceOf[ScalaPresentationCompiler.PresentationReporter]
presentationReporter.compiler = this

0 comments on commit d635441

Please sign in to comment.
Something went wrong with that request. Please try again.