Permalink
Browse files

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

…ickFixTypeMismatch
  • Loading branch information...
2 parents ef389f1 + ca44dc9 commit c9e80956fe43485c79ca5691b05c1f1c3e1a8fc3 @kaptoxic kaptoxic committed Sep 29, 2012
Showing with 922 additions and 353 deletions.
  1. +3 −1 eclipse-director.sh
  2. +1 −0 org.scala-ide.product/.gitignore
  3. +156 −0 org.scala-ide.product/pom.xml
  4. +7 −0 org.scala-ide.product/scalaide.p2.inf
  5. +80 −0 org.scala-ide.product/scalaide.product
  6. +1 −4 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/EclipseUserSimulator.scala
  7. +18 −0 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/completion/CompletionTests.scala
  8. +32 −17 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/hyperlink/HyperlinkDetectorTests.scala
  9. +4 −10 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/hyperlink/HyperlinkTester.scala
  10. +5 −4 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/occurrences/OccurrencesFinderTest.scala
  11. +7 −0 org.scala-ide.sdt.core.tests/test-workspace/completion/src/ticket_1001207/T1207.scala
  12. +1 −1 org.scala-ide.sdt.core.tests/test-workspace/hyperlinks/src/bug1000656/Client.scala
  13. +2 −1 org.scala-ide.sdt.core.tests/test-workspace/hyperlinks/src/hyperlinks/SimpleHyperlinking.scala
  14. +12 −0 org.scala-ide.sdt.core.tests/test-workspace/hyperlinks/src/scalalinks/ScalaListLinks.scala
  15. +5 −0 org.scala-ide.sdt.core.tests/test-workspace/hyperlinks/src/t1001215/A.scala
  16. +1 −0 org.scala-ide.sdt.core/.classpath
  17. +6 −0 org.scala-ide.sdt.core/about.mappings
  18. +5 −1 org.scala-ide.sdt.core/build.properties
  19. BIN org.scala-ide.sdt.core/intro-scala.png
  20. +24 −0 org.scala-ide.sdt.core/plugin.properties
  21. +47 −0 org.scala-ide.sdt.core/plugin.xml
  22. +50 −0 org.scala-ide.sdt.core/plugin_customization.ini
  23. +17 −0 org.scala-ide.sdt.core/pom.xml
  24. BIN org.scala-ide.sdt.core/product.png
  25. +17 −0 org.scala-ide.sdt.core/src-2.10/scala/tools/eclipse/SymbolsCompatibility.scala
  26. +10 −0 org.scala-ide.sdt.core/src-2.9/scala/tools/eclipse/SymbolsCompatibility.scala
  27. +14 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/InteractiveCompilationUnit.scala
  28. +14 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/PreferenceInitializer.scala
  29. +5 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaClassFileEditor.scala
  30. +0 −14 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaDamagerRepairer.scala
  31. +2 −3 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaEditor.scala
  32. +31 −37 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaHover.scala
  33. +166 −155 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaPresentationCompiler.scala
  34. +2 −2 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaProject.scala
  35. +29 −18 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaSourceFileEditor.scala
  36. +11 −7 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaSourceViewerConfiguration.scala
  37. +4 −1 ...ala-ide.sdt.core/src/scala/tools/eclipse/buildmanager/sbtintegration/EclipseSbtBuildManager.scala
  38. +1 −2 org.scala-ide.sdt.core/src/scala/tools/eclipse/diagnostic/StartupDiagnostics.scala
  39. +1 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/hyperlink/text/detector/BaseHyperlinkDetector.scala
  40. +28 −16 ...a-ide.sdt.core/src/scala/tools/eclipse/hyperlink/text/detector/DeclarationHyperlinkDetector.scala
  41. +22 −11 ....sdt.core/src/scala/tools/eclipse/hyperlink/text/detector/ScalaDeclarationHyperlinkComputer.scala
  42. +0 −8 org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaCompilationUnit.scala
  43. +1 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaJavaMapper.scala
  44. +3 −3 org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaOverrideIndicatorBuilder.scala
  45. +3 −3 org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaSelectionEngine.scala
  46. +4 −4 org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaStructureBuilder.scala
  47. +27 −10 org.scala-ide.sdt.core/src/scala/tools/eclipse/markoccurrences/ScalaOccurrencesFinder.scala
  48. +2 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/properties/IDESettings.scala
  49. +1 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/properties/ImplicitsPreferencePage.scala
  50. +1 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/properties/ScalaCompilerPreferenceInitializer.scala
  51. +1 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/refactoring/EditorHelpers.scala
  52. +4 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/refactoring/ExtractMethodAction.scala
  53. +4 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/refactoring/InlineLocalAction.scala
  54. +4 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/refactoring/rename/LocalRenameAction.scala
  55. +3 −1 org.scala-ide.sdt.core/src/scala/tools/eclipse/semantichighlighting/classifier/SafeSymbol.scala
  56. +9 −0 org.scala-ide.sdt.core/src/scala/tools/eclipse/ui/InteractiveCompilationUnitEditor.scala
  57. +7 −11 org.scala-ide.sdt.core/src/scala/tools/eclipse/util/EditorUtils.scala
  58. +1 −0 org.scala-ide.sdt.feature/feature.xml
  59. +6 −0 org.scala-ide.sdt.update-site/plugin-signing.sh
View
@@ -132,7 +132,9 @@ while [ $# -gt 0 ]; do
$eclipse_dir/eclipse $eclipse_opt \
-application $app \
-repository $eclipse_repo \
- -list
+ -list \
+ | grep feature.group \
+ | awk -F "=" '{print $1}'
shift
;;
@@ -0,0 +1 @@
+target/
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.scala-ide</groupId>
+ <artifactId>org.scala-ide.build</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.scala-ide.product</artifactId>
+ <packaging>eclipse-repository</packaging>
+
+ <properties>
+ <!-- some default values, can be overwritten by profiles -->
+ <repo.scala-ide.ecosystem>${repo.scala-ide.root}/ecosystem/dev-milestone-2.9/site/</repo.scala-ide.ecosystem>
+ </properties>
+
+ <profiles>
+ <profile>
+ <!--- the profile using the default values. Scala 2.9.x -->
+ <id>scala-2.9.x</id>
+ </profile>
+
+ <profile>
+ <!-- Scala 2.10.x -->
+ <id>scala-2.10.x</id>
+ <properties>
+ <repo.scala-ide.ecosystem>${repo.scala-ide.root}/ecosystem/dev-milestone-milestone/site/</repo.scala-ide.ecosystem>
+ <scala.major.minor.version>2.10.0-M7</scala.major.minor.version>
+ </properties>
+ </profile>
+ </profiles>
+
+ <repositories>
+ <repository>
+ <id>scala-ide ecosystem</id>
+ <url>${repo.scala-ide.ecosystem}</url>
+ <layout>p2</layout>
+ </repository>
+ <repository>
+ <id>eclipse.${eclipse.codename}</id>
+ <name>Eclipse p2 repository</name>
+ <layout>p2</layout>
+ <url>${repo.eclipse}</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>ajdt.${eclipse.codename}</id>
+ <name>AJDT for Eclipse p2 repository</name>
+ <layout>p2</layout>
+ <url>${repo.ajdt}</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <!-- enable tycho to support eclipse type artifacts -->
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho.plugin.version}</version>
+ <configuration>
+ <environments>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>carbon</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-repository-plugin</artifactId>
+ <version>${tycho.plugin.version}</version>
+ <configuration>
+ <includeAllDependencies>true</includeAllDependencies>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-director-plugin</artifactId>
+ <version>${tycho.plugin.version}</version>
+ <executions>
+ <execution>
+ <id>materialize-products</id>
+ <goals>
+ <goal>materialize-products</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>archive-products</id>
+ <goals>
+ <goal>archive-products</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <formats>
+ <linux>tar.gz</linux>
+ </formats>
+ <products>
+ <product>
+ <id>scalaide.product.id</id>
+ <rootFolder>eclipse</rootFolder>
+ <archiveFileName>scala-SDK-2.1-M2-${scala.major.minor.version}</archiveFileName>
+ </product>
+ </products>
+ <installFeatures>true</installFeatures>
+ <profile>SDKProfile</profile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
@@ -0,0 +1,7 @@
+instructions.configure=\
+ addRepository(type:0,location:http${#58}//download.eclipse.org/eclipse/updates/3.7,name:The Eclipse Project Updates);\
+ addRepository(type:1,location:http${#58}//download.eclipse.org/eclipse/updates/3.7,name:The Eclipse Project Updates);\
+ addRepository(type:0,location:http${#58}//download.eclipse.org/releases/indigo,name:Indigo);\
+ addRepository(type:1,location:http${#58}//download.eclipse.org/releases/indigo,name:Indigo);\
+ addRepository(type:0,location:http${#58}//download.scala-ide.org/ecosystem/dev-milestone-2.9/site/,name:Scala IDE);\
+ addRepository(type:1,location:http${#58}//download.scala-ide.org/ecosystem/dev-milestone-2.9/site/,name:Scala IDE);
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="Typesafe Scala IDE" uid="scalaide.product.id" id="org.scala-ide.sdt.product" application="org.eclipse.ui.ide.workbench" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
+
+ <aboutInfo>
+ <image path="eclipse_lg.gif"/>
+ <text>
+ %productBlurb
+ </text>
+ </aboutInfo>
+
+ <configIni use="default">
+<!-- <macosx>config.ini</macosx>
+ <linux>config.ini</linux>
+ <win32>config.ini</win32> -->
+ </configIni>
+
+ <launcherArgs>
+ <vmArgs>-Xmx1500m
+-Xms100m
+-XX:MaxPermSize=128m</vmArgs>
+ <vmArgsMac>
+-XstartOnFirstThread
+-Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+
+ <windowImages i16="eclipse.gif" i32="eclipse32.gif" i48="eclipse48.gif" i64="eclipse.png" i128="eclipse32.png"/>
+
+ <splash
+ location="org.eclipse.platform"
+ startupProgressRect="0,280,455,15"
+ startupMessageRect="7,220,441,20"
+ startupForegroundColor="C8D5EA" />
+ <launcher>
+ <solaris/>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+
+ <intro introId="org.eclipse.ui.intro.universal"/>
+
+ <vm>
+ <macos include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</macos>
+ </vm>
+
+ <features>
+ <feature id="org.scala-ide.sdt.feature"/>
+ <feature id="org.scala-ide.sdt.weaving.feature"/>
+ <feature id="org.scalaide.worksheet.feature"/>
+ <feature id="org.eclipse.cvs"/>
+ <feature id="org.eclipse.equinox.p2.core.feature"/>
+ <feature id="org.eclipse.equinox.p2.extras.feature"/>
+ <feature id="org.eclipse.equinox.p2.rcp.feature"/>
+ <feature id="org.eclipse.equinox.p2.user.ui"/>
+ <feature id="org.eclipse.equinox.weaving.sdk"/>
+ <feature id="org.eclipse.help"/>
+ <feature id="org.eclipse.pde"/>
+ <feature id="org.eclipse.jdt"/>
+ <feature id="org.eclipse.platform"/>
+ <feature id="org.eclipse.rcp"/>
+ </features>
+ <configurations>
+ <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
+ <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
+
+ <!-- Needed in order for the update manager to work. -->
+ <plugin id="org.eclipse.equinox.common" autostart="true" startLevel="2" />
+ <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="4" />
+ <plugin id="org.eclipse.update.configurator" autostart="true" level="4" />
+ <property name="equinox.use.ds" value="true" />
+ <property name="org.eclipse.update.reconcile" value="false" />
+
+ <property name="eclipse.p2.data.area" value="@config.dir/../p2/" />
+ <property name="eclipse.p2.profile" value="SDKProfile" />
+ <property name="eclipse.buildId" value="2.1-M2-Typesafe" />
+ </configurations>
+
+</product>
@@ -34,10 +34,7 @@ class EclipseUserSimulator {
javaProject.setOutputLocation(new Path("/" + projectName + "/bin"), null);
var entries = new ArrayBuffer[IClasspathEntry]();
- val vmInstall = JavaRuntime.getDefaultVMInstall();
- val locations = JavaRuntime.getLibraryLocations(vmInstall);
- for (element <- locations)
- entries += JavaCore.newLibraryEntry(element.getSystemLibraryPath(), null, null);
+ entries += JavaRuntime.getDefaultJREContainerEntry()
if (withSourceRoot) {
val sourceFolder = project.getFolder("/src");
@@ -217,4 +217,22 @@ class CompletionTests {
runTest("t1001014/F.scala", false)(oracle)
}
+
+ @Test
+ def t1001207() {
+ val unit = scalaCompilationUnit("ticket_1001207/T1207.scala")
+ reload(unit)
+
+ withCompletions("ticket_1001207/T1207.scala") {
+ (index, position, completions) =>
+ assertEquals("There is only one completion location", 0, index)
+ assertTrue("The completion should return java.util", completions.exists(
+ _ match {
+ case CompletionProposal(MemberKind.Package, _, "util", _, _, _, _, _, _, _, _, _) =>
+ true
+ case _ =>
+ false
+ }))
+ }
+ }
}
@@ -16,26 +16,34 @@ object HyperlinkDetectorTests extends TestProjectSetup("hyperlinks") with Hyperl
class HyperlinkDetectorTests {
import HyperlinkDetectorTests._
-
+
@Test
def simpleHyperlinks() {
- val unit = scalaCompilationUnit("hyperlinks/SimpleHyperlinking.scala")
+ val oracle = List(
+ Link("type scala.Predef.Set"),
+ Link("type hyperlinks.SimpleHyperlinking.Tpe"),
+ Link("method scala.Array.apply", "object scala.Array"),
+ Link("method scala.collection.TraversableOnce.sum"),
+ Link("type scala.Predef.String"),
+ Link("object scala.Some"),
+ Link("class scala.Option"),
+ Link("type scala.Predef.String"))
- reload(unit)
+ loadTestUnit("hyperlinks/SimpleHyperlinking.scala").andCheckAgainst(oracle)
+ }
+
+ @Test
+ def scalaPackageLinks() {
+ val oracle = List(
+ Link("method scala.collection.immutable.List.apply", "object scala.collection.immutable.List"),
+ Link("object scala.collection.immutable.List"),
+ Link("method scala.collection.generic.GenericCompanion.apply", "object scala.collection.Seq"),
+ Link("object scala.collection.Seq"),
+ Link("object scala.collection.immutable.Nil"),
+ Link("method scala.collection.LinearSeqOptimized.apply", "value scalalinks.Foo.xs")
+ )
- val contents = unit.getContents
- val positions = SDTTestUtils.positionsOf(contents, "/*^*/")
-
- println("checking %d positions".format(positions.size))
- val resolver = new ScalaDeclarationHyperlinkComputer
- for (pos <- positions) {
- val wordRegion = ScalaWordFinder.findWord(unit.getContents, pos - 1)
- val word = new String(unit.getContents.slice(wordRegion.getOffset, wordRegion.getOffset + wordRegion.getLength))
- val links = resolver.findHyperlinks(unit, wordRegion)
- println("Found links: " + links)
- assertTrue(links.isDefined)
- assertEquals("Failed hyperlinking at position %d (%s)".format(pos, word), 1, links.get.size)
- }
+ loadTestUnit("scalalinks/ScalaListLinks.scala").andCheckAgainst(oracle)
}
@Test
@@ -76,7 +84,14 @@ class HyperlinkDetectorTests {
// and make sure the classpath is up to date
project.resetPresentationCompiler()
- val oracle = List(Link("type util.Box.myInt"), Link("method util.Full.apply"))
+ val oracle = List(Link("type util.Box.myInt"), Link("method util.Full.apply", "object util.Full"))
loadTestUnit("bug1000656/Client.scala").andCheckAgainst(oracle)
}
+
+ @Test
+ def hyperlinkOnList_t1001215() {
+ val oracle = List(Link("method scala.collection.immutable.List.apply", "object scala.collection.immutable.List"))
+
+ loadTestUnit("t1001215/A.scala").andCheckAgainst(oracle)
+ }
}
@@ -15,7 +15,7 @@ trait HyperlinkTester extends TestProjectSetup {
private final val HyperlinkMarker = "/*^*/"
- case class Link(text: String)
+ case class Link(text: String*)
/** Given a source `path`, load the corresponding scala `unit`. */
def loadTestUnit(path: String): VerifyHyperlink = {
@@ -47,15 +47,9 @@ trait HyperlinkTester extends TestProjectSetup {
// Verify Expectations
assertTrue("no links found for `%s`".format(word), maybeLinks.isDefined)
val links = maybeLinks.get
- assertEquals("expected %d link, found %d".format(1, links.size), 1, links.size)
- val link = links.head
- assertEquals("text", oracle.text, link.getTypeLabel)
- //assertEquals("offset", oracle.region.getOffset(), link.getHyperlinkRegion().getOffset())
- unit.withSourceFile({ (sourceFile, compiler) =>
- val offset = link.getHyperlinkRegion().getOffset()
- val length = link.getHyperlinkRegion().getLength
- val linkedPos = compiler.rangePos(sourceFile, offset, offset, offset + length)
- })(None)
+ assertEquals("expected %d link, found %d".format(oracle.text.size, links.size), oracle.text.size, links.size)
+ val linkResults = links map (_.getTypeLabel)
+ assertEquals("text", oracle.text.toList.toString, linkResults.toList.toString)
}
}
}
Oops, something went wrong.

0 comments on commit c9e8095

Please sign in to comment.