Permalink
Browse files

Merge branch 'master' of git://github.com/scala-ide/scala-ide into qu…

…ickFixTypeMismatch
  • Loading branch information...
2 parents 36ca807 + b029fa2 commit 749925adabd793afc7a64d56e4ca6b24c93dd77b @kaptoxic kaptoxic committed Aug 21, 2012
Showing with 1,161 additions and 1,077 deletions.
  1. +15 −18 org.scala-ide.sbt.full.library/.classpath
  2. +29 −72 org.scala-ide.sbt.full.library/pom.xml
  3. +1 −1 org.scala-ide.sdt.build/pom.xml
  4. +2 −2 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/classpath/ClasspathTests.scala
  5. +2 −5 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/compiler/settings/CompilerSettingsTest.scala
  6. +0 −15 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/sbtbuilder/SbtBuilderTest.scala
  7. +12 −0 ...scala-ide.sdt.core.tests/src/scala/tools/eclipse/semantichighlighting/classifier/ObjectTest.scala
  8. +51 −21 ...ala-ide.sdt.core.tests/src/scala/tools/eclipse/semantichighlighting/classifier/RegionParser.scala
  9. +219 −0 ...de.sdt.core.tests/src/scala/tools/eclipse/semantichighlighting/classifier/TypeParameterTest.scala
  10. +24 −27 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/semantichighlighting/classifier/TypeTest.scala
  11. +2 −1 org.scala-ide.sdt.core/META-INF/MANIFEST.MF
  12. +8 −0 org.scala-ide.sdt.core/plugin.xml
  13. +106 −0 org.scala-ide.sdt.core/schema/sourceFileProviders.exsd
  14. +0 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/InteractiveCompilationUnit.scala
  15. +12 −11 org.scala-ide.sdt.core/src/scala/tools/eclipse/LocateSymbol.scala
  16. +3 −3 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaPlugin.scala
  17. +62 −44 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaProject.scala
  18. +3 −2 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaSourceViewerConfiguration.scala
  19. +21 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/BuildProblemMarker.scala
  20. +6 −9 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/BuildReporter.scala
  21. +0 −181 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/AnalysisCompile.scala
  22. +84 −155 ...ala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/EclipseSbtBuildManager.scala
  23. +21 −13 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/JavaEclipseCompiler.scala
  24. +0 −25 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/SbtBuildLogger.scala
  25. +33 −128 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/SbtBuildReporter.scala
  26. +0 −117 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/SbtConf.scala
  27. +104 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/SbtInputs.scala
  28. +0 −48 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/ScalaSbtCompiler.scala
  29. +0 −30 org.scala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/WeaklyCachedStore.scala
  30. +1 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/completion/ScalaJavaCompletionProposalComputer.scala
  31. +2 −4 org.scala-ide.sdt.core/src/scala/tools/eclipse/formatter/ScalaFormattingStrategy.scala
  32. +15 −7 org.scala-ide.sdt.core/src/scala/tools/eclipse/hyperlink/text/Hyperlink.scala
  33. +4 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/hyperlink/text/detector/BaseHyperlinkDetector.scala
  34. +2 −9 ...ols/eclipse/hyperlink/text/detector/{HyperlinksDetector.scala → CompositeHyperlinkDetector.scala}
  35. +7 −15 org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaClassFile.scala
  36. +1 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompilationUnit.scala
  37. +13 −2 org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaSourceFile.scala
  38. +13 −6 org.scala-ide.sdt.core/src/scala/tools/eclipse/resources/MarkerFactory.scala
  39. +66 −3 org.scala-ide.sdt.core/src/scala/tools/eclipse/semantichighlighting/classifier/SafeSymbol.scala
  40. +9 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/sourcefileprovider/SourceFileProvider.scala
  41. +56 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/sourcefileprovider/SourceFileProviderRegistry.scala
  42. +9 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/util/OSGiUtils.scala
  43. +8 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/util/SWTUtils.scala
  44. +1 −0 org.scala-ide.sdt.debug.tests/src/scala/tools/eclipse/debug/ScalaDebugRunningTest.scala
  45. +28 −1 org.scala-ide.sdt.debug.tests/src/scala/tools/eclipse/debug/ScalaDebugSteppingTest.scala
  46. +20 −3 org.scala-ide.sdt.debug.tests/src/scala/tools/eclipse/debug/ScalaDebugTestSession.scala
  47. +18 −0 org.scala-ide.sdt.debug.tests/src/scala/tools/eclipse/debug/model/ScalaThreadTest.scala
  48. +15 −0 org.scala-ide.sdt.debug.tests/test-workspace/debug/AnonFunOnListInt.launch
  49. +4 −0 org.scala-ide.sdt.debug.tests/test-workspace/debug/src/stepping/AnonFunOnListInt.scala
  50. +1 −1 org.scala-ide.sdt.debug/META-INF/MANIFEST.MF
  51. +1 −2 org.scala-ide.sdt.debug/src/scala/tools/eclipse/debug/command/ScalaStepOver.scala
  52. +0 −1 org.scala-ide.sdt.debug/src/scala/tools/eclipse/debug/model/ScalaThread.scala
  53. +47 −89 pom.xml
@@ -1,23 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="lib/api_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/classfile_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/classpath_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/collections_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/compile_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/control_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/incremental-compiler_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/interface_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/io_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/ivy_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/ivy.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/api_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/classfile_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/classpath_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/compile_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/compiler-integration_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/compiler-interface_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/control_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/incremental-compiler_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/interface_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/io_2.9.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jline.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/launcher_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/launcher-interface_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/logging_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/persist_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/precompiled-2.9.1-2_9_1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/process_2.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/sbinary_2.9.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/logging_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/persist_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/process_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/relation_2.9.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/sbinary_2.9.2.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
@@ -23,99 +23,82 @@
<dependencies>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>api_${sbt.compiled.version}</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>classfile_${sbt.compiled.version}</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.scala-tools.sbt</groupId>
+ <groupId>org.scala-sbt</groupId>
<artifactId>classpath_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>collections_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>logging_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>compile_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>io_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
- <dependency>
- <groupId>org.scala-tools.sbt</groupId>
+ <dependency>
+ <groupId>org.scala-sbt</groupId>
<artifactId>control_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>incremental-compiler_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>classfile_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
- <dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>io_${sbt.compiled.version}</artifactId>
+ <dependency>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>process_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>ivy_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>relation_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>launcher-interface_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>interface_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>logging_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>persist_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>persist_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>api_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>process_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>compiler-integration_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
- <!-- all the other dependencies -->
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>launcher_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>incremental-compiler_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
- <!-- use the interface with which we were built -->
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>precompiled-${sbt.compiled.version}-${scala.precompiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>compile_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>interface_${sbt.compiled.version}</artifactId>
+ <groupId>org.scala-sbt</groupId>
+ <artifactId>compiler-interface_${sbt.compiled.version}</artifactId>
<optional>true</optional>
</dependency>
- <!-- all the dependencies necessary for running like sbinary, ivy, jline -->
+ <!-- all the dependencies necessary for running like sbinary, jline -->
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.apache.ivy</groupId>
- <artifactId>ivy</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
<groupId>org.scala-tools.sbinary</groupId>
<artifactId>sbinary_${sbt.compiled.version}</artifactId>
<optional>true</optional>
@@ -147,31 +130,6 @@
</configuration>
</plugin>
<plugin>
- <!-- copy the compiler interfaces with the right name -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>compile</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.scala-tools.sbt</groupId>
- <artifactId>precompiled-${sbt.compiled.version}-${scala.precompiled.version}</artifactId>
- <type>jar</type>
- <destFileName>scala-${scala.major.minor.version}/lib/compiler-interface.jar</destFileName>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<!-- generate the MANIFEST.MF file, and create the bundle -->
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
@@ -186,7 +144,6 @@
<_exportcontents>sbt.*;version=${sbt.version},xsbt.*;version=${sbt.version},xsbti.*;version=${sbt.version},sbinary.*;version=${sbinary.version},jline.*;version=0.9.94,org.apache.ivy.*;version=2.2.0</_exportcontents>
<Embed-Directory>lib</Embed-Directory>
<Embed-StripVersion>true</Embed-StripVersion>
- <Include-Resource>lib=${project.build.directory}/lib</Include-Resource>
<Import-Package>!org.apache.ivy.*,!org.bouncycastle.*,!org.scalatools.testing.*,!com.craft.*,!com.jcraft.*,!sun.misc,!org.apache.commons.vfs,!org.apache.commons.vfs.impl,!org.apache.oro.text,!org.apache.oro.text
.regex,*</Import-Package>
</instructions>
@@ -210,7 +210,7 @@
<frameworkExtension>
<groupId>p2.osgi.bundle</groupId>
<artifactId>org.eclipse.equinox.weaving.hook</artifactId>
- <version>1.0.200.I20120427-0800</version>
+ <version>${weaving.hook.plugin.version}</version>
</frameworkExtension>
</frameworkExtensions>
<bundleStartLevel>
@@ -234,10 +234,10 @@ class ClasspathTests {
project.classpathHasChanged() // trick to make the check happen
- val errors = projectErrors(ScalaPlugin.plugin.problemMarkerId, ScalaPlugin.plugin.settingProblemMarkerId)
+ val errors = projectErrors(ScalaPlugin.plugin.settingProblemMarkerId)
// on 2.8 an invalid setting is reported twice, so the total number of errors is 3 or 4
- assertTrue("unexpected number of scala problems in project: " + errors, errors.length >= 3)
+ assertTrue("unexpected number of scala problems in project: " + errors, errors.length >= 1)
// back to normal
project.storage.setValue(CompilerSettings.ADDITIONAL_PARAMS, "")
@@ -19,10 +19,7 @@ class CompilerSettingsTest {
val errors = allBuildErrorsOf(unit)
- if(ScalaPlugin.plugin.shortScalaVer == "2.9")
- assertTrue(errors.nonEmpty)
- else
- assertTrue(errors.isEmpty) // continuations plugin is enabled by default in 2.10+
+ assertTrue(errors.nonEmpty)
}
@Test
@@ -49,4 +46,4 @@ class CompilerSettingsTest {
project.storage.setValue("P", value)
}
}
-}
+}
@@ -132,18 +132,6 @@ class SbtBuilderTest {
assertNoErrors(fooClientCU)
}
- @Test def scalaLibrary_shouldBe_on_BootClasspath() {
- import SDTTestUtils._
-
- val Seq(prjClient) = createProjects("client")
-
- Assert.assertTrue("Found Scala library", prjClient.scalaClasspath.scalaLib.isDefined)
- val basicConf = new BasicConfiguration(prjClient, ScalaCompilerConf.deployedInstance)
- val args = basicConf.buildArguments(Seq())
- Assert.assertTrue("BasicConfiguration bootclasspath " + args, args.mkString(" ").contains("-bootclasspath %s".format(prjClient.scalaClasspath.scalaLib.get.toFile.getAbsolutePath)))
- deleteProjects(prjClient)
- }
-
@Test def scalaLibrary_in_dependent_project_shouldBe_on_BootClasspath() {
import SDTTestUtils._
import ScalaPlugin.plugin
@@ -167,9 +155,6 @@ class SbtBuilderTest {
val expectedLib = plugin.workspaceRoot.findMember("/library/bin").getLocation
Assert.assertEquals("Unexpected Scala lib", expectedLib, prjClient.scalaClasspath.scalaLib.get)
- val basicConf = new BasicConfiguration(prjClient, ScalaCompilerConf.deployedInstance)
- val args = basicConf.buildArguments(Seq())
- Assert.assertTrue("BasicConfiguration bootclasspath " + args, args.mkString(" ").contains("-bootclasspath " + expectedLib))
deleteProjects(prjClient, prjLib)
}
@@ -58,4 +58,16 @@ class ObjectTest extends AbstractSymbolClassifierTest {
""",
Map("OBJ" -> Object, "PKG" -> Package))
}
+
+ @Test
+ def object_member_within_type_param() {
+ checkSymbolClassification("""
+ object TypeA { class TypeB }
+ trait Trait extends Seq[TypeA.TypeB]
+ """, """
+ object TypeA { class TypeB }
+ trait Trait extends $T$[$OBJ$.$CLS$]
+ """,
+ Map("CLS" -> Class, "OBJ" -> Object, "T" -> Type))
+ }
}
@@ -1,27 +1,57 @@
package scala.tools.eclipse.semantichighlighting.classifier
-/**
- * Search for regions delimited with $ signs.
- */
object RegionParser {
- def getRegions(text: String): Map[Region, String] = {
- var regions = Map[Region, String]()
- var regionStartOpt: Option[Int] = None
+ /**
+ * Search for regions delimited with a sign. In the default case the
+ * delimited sign is a '$'.
+ *
+ * It is possible to put delimiter signs into the text by escaping them with
+ * a '\'.
+ *
+ * @example {{{
+ * scala> getRegions("""$abc$ def $ghi$""")
+ * res200: Map[Region,String] = Map(Region(0,5) -> abc, Region(10,5) -> ghi)
+ *
+ * scala> getRegions("""$a\$bc$ de\$f $ghi$""")
+ * res201: Map[Region,String] = Map(Region(0,6) -> a$bc, Region(12,5) -> ghi)
+ *
+ * scala> getRegions("""|a\|bc| de\|f |ghi|""", delimiter = '|')
+ * res202: Map[Region,String] = Map(Region(0,6) -> a|bc, Region(12,5) -> ghi)
+ * }}}
+ * '''Note:''' When a delimiter sign is escaped, the resulting `Region` instances
+ * are handled as there were no escape sign. This means that the String `$a\$b$`
+ * is treated as `$a$b$`.
+ */
+ def getRegions(text: String, delimiter: Char = '$'): Map[Region, String] = {
+ val sb = new StringBuilder
+ var curPos = 0
+ var offset = 0
+ var regions = Map.empty[Region, String]
- for (('$', pos) <- text.zipWithIndex)
- regionStartOpt match {
- case Some(regionStart) =>
- regionStartOpt = None
- val region = Region(regionStart, pos - regionStart + 1)
- val regionLabel = text.substring(regionStart + 1, pos).trim
- regions += (region -> regionLabel)
- case None =>
- regionStartOpt = Some(pos)
- }
-
- require(regionStartOpt.isEmpty)
- regions
+ while (curPos < text.length) {
+ text.charAt(curPos) match {
+ case '\\' if text.charAt(curPos+1) == delimiter =>
+ if (!sb.isEmpty)
+ sb += delimiter
+ offset += 1
+ curPos += 1
+ case `delimiter` =>
+ if (sb.isEmpty)
+ sb += text.charAt(curPos)
+ else {
+ val start = curPos-sb.length
+ val label = sb.substring(1, sb.length).trim
+ sb.clear()
+ regions += (Region(start-offset, curPos-start+1) -> label)
+ }
+ case _ =>
+ if (!sb.isEmpty)
+ sb += text.charAt(curPos)
+ }
+ curPos += 1
}
-
- }
+ require(sb.isEmpty, "odd number of '"+delimiter+"' signs in text")
+ regions
+ }
+}
Oops, something went wrong.

0 comments on commit 749925a

Please sign in to comment.