scala-ide / scala-search

Next Scala Search Engine
6 stars 10 forks source link

1001759 type hierarchy view supertypes #68

Closed mads-hartmann closed 11 years ago

mads-hartmann commented 11 years ago

This adds the super-types to the type-hierarchy as well

dotta commented 11 years ago

Oooh, this is new! :) I guess we'll get to it on Friday (tomorrow, Thursday, is the National Swiss Day, so the whole Lausanne team is on vacation ;-))

dotta commented 11 years ago

Mmmm, how come that despite the failures, this PR is good to merge? \cc @adriaanm @dragos

dotta commented 11 years ago

I've built the plug-in locally and installed it, and I get the following:

java.io.FileNotFoundException: /icons/type-hierarchy-scala.gif
    at org.eclipse.osgi.framework.internal.protocol.bundleentry.Handler.findBundleEntry(Handler.java:44)
    at org.eclipse.osgi.framework.internal.core.BundleResourceHandler.openConnection(BundleResourceHandler.java:175)
    at java.net.URL.openConnection(URL.java:971)
    at org.eclipse.core.internal.boot.PlatformURLConnection.connect(PlatformURLConnection.java:110)
    at org.eclipse.core.internal.boot.PlatformURLConnection.getURLAsLocal(PlatformURLConnection.java:238)
    at org.eclipse.core.internal.runtime.PlatformURLConverter.toFileURL(PlatformURLConverter.java:36)
    at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:206)
    at org.eclipse.jface.resource.URLImageDescriptor.getFilePath(URLImageDescriptor.java:137)
    at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:157)
    at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:227)
    at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:205)

By the way, the current plugin-profiles parent POM doesn't have the right values for building with the scala-ide-nightly profile. I'm updating it, but in the meanwhile you can build your plug-in against IDE master with the following:

mvn -Peclipse-juno -Pscala-ide-nightly -Pscala-2.10.x -Dscala-ide.repo=http://download.scala-ide.org/nightly-scala-ide-4.0.x-210x clean install
mads-hartmann commented 11 years ago

Hm, running it directly from inside of Eclipse it can find the icon. Do you see the icon in the folder? Maybe I forgot to add the icons folder to the manifest?

Yeah, I've been building the project like that since I came home from vacation, so it would be nice to update the POM ;)

dotta commented 11 years ago

Hm, running it directly from inside of Eclipse it can find the icon. Do you see the icon in the folder? Maybe I forgot to add the icons folder to the manifest?

I believe you need to add it to your build.properties. I'm doing that now, will see if it helps.

Yeah, I've been building the project like that since I came home from vacation, so it would be nice to update the POM ;)

I just released the new profile, but it will take a few hours before it is sync in maven central. I'll open a PR the moment it's good.

dotta commented 11 years ago

And this is what I get the moment I ask for type hierarchy on EclipseImplicits

org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
    at org.eclipse.swt.SWT.error(SWT.java:4397)
    at org.eclipse.swt.SWT.error(SWT.java:4312)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3976)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3653)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
Caused by: org.eclipse.swt.SWTException: Widget is disposed
    at org.eclipse.swt.SWT.error(SWT.java:4397)
    at org.eclipse.swt.SWT.error(SWT.java:4312)
    at org.eclipse.swt.SWT.error(SWT.java:4283)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:783)
    at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:573)
    at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:1741)
    at org.eclipse.jface.viewers.TreeViewer.getSelection(TreeViewer.java:256)
    at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:344)
    at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2544)
    at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2967)
    at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1450)
    at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403)
    at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1404)
    at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1506)
    at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:544)
    at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1465)
    at org.scala.tools.eclipse.search.ui.TypeHierarchyTreeContentProvider$$anon$1$$anon$2.run(TypeHierarchyTreeContentProvider.scala:158)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

EDIT:

Oh, this happens the moment I close the Type Hierarchy View. Should be easy to fix ;-)

dotta commented 11 years ago

Hm, running it directly from inside of Eclipse it can find the icon. Do you see the icon in the folder? Maybe I forgot to add the icons folder to the manifest?

I believe you need to add it to your build.properties. I'm doing that now, will see if it helps.

I confirm this fixes it. I've opened a PR against your branch

dotta commented 11 years ago

Also, no supertype is found for EclipseImplicits. I would expect to see Object or, maybe better, AnyRef and Any

dotta commented 11 years ago

Mmmm, also for Lifecycle I get nothing back (no super/sub types)... so I'm thinking something must be wrong with my local install. Could you check if it works for you...

mads-hartmann commented 11 years ago

@dotta Currently it only shows the super/subtypes that it has the sources for so that's why Object isn't showing up. That probably isn't what we want, so I'll have a look at it :)

dotta commented 11 years ago

Mmmm, also for Lifecycle I get nothing back (no super/sub types)... so I'm thinking something must be wrong with my local install. Could you check if it works for you...

Actually, it does work in other scenarios, so I think I'm hitting a bug here...

mads-hartmann commented 11 years ago

Actually, it does work in other scenarios, so I think I'm hitting a bug here...

Allright, I'll try the plugin on the IDE sources :)

dotta commented 11 years ago

I've done a first pass. Overall, I think this is a great PR. Though, I'd love to see some more tests :-)

mads-hartmann commented 11 years ago

@dotta Awesome! :) I'm working on ticket 1001794 now and I'll complete that first. I'll address all your comments tonight or tomorrow :) We should be good to launch on monday!

dotta commented 11 years ago

So that you know, I've updated the Scala Search PR validation jobs to accomodate this PR https://github.com/scala-ide/scala-search/pull/69. This means that any further rebuild of this branch will likely fail. I think that's fine for the moment, we'll rebase this branch before merging so that we can make sure it compiles fine.

dotta commented 11 years ago

@dotta Awesome! :) I'm working on ticket 1001794 now and I'll complete that first. I'll address all your comments tonight or tomorrow :) We should be good to launch on monday!

Sounds great!

mads-hartmann commented 11 years ago

Mmmm, also for Lifecycle I get nothing back (no super/sub types)... so I'm thinking something must be wrong with my local install. Could you check if it works for you...

@dotta I just tried and I did find sub-types. Can you try to delete your local index manually. I'm thinking that the index you have locally might be from a previous version of the plugin and that it hasn't re-indexed everything yet and thus lacks some information. You'll find the index in <workspace>/.metadata/.plugins/org.scala.tools.eclipse.search/lucene-indices/

screenshot on 2013-08-05 at 10 37 35

mads-hartmann commented 11 years ago

Oh, this happens the moment I close the Type Hierarchy View. Should be easy to fix ;-)

Fixed in b245c16

mads-hartmann commented 11 years ago

@dotta The current implementation only shows super/sub-types that are defined in the workspace. This is why you never see Object or AnyRef. I would actually like to keep it that was until we support attached sources if you don't mind :)

skyluc commented 11 years ago

The Super-class of ... tree viewer contains No subtypes when it is empty. It should say No supertypes.

mads-hartmann commented 11 years ago

@skyluc screenshot on 2013-08-06 at 09 30 35

Does it look stupid with the hyphen? I mean, is it supertypes or super-types?

dotta commented 11 years ago

Overall, this LGTM!

Turns out I had a few more comments, so let's wait a bit more before shipping this :)

Though, before merging, we need @dragos to comment on this

dotta commented 11 years ago

Asking for Type Hierarchy on A doesn't show subclass B. While it works fine if you ask TypeHierarchy for B

trait A // <-- ask type hierarchy here

object B {
  type AA = A
}

trait B extends B.AA
dotta commented 11 years ago

And another good one is

trait M[K,V]

trait C extends M[String, Int] // <-- ask type hierarchy on `M` here

trait D extends M[Boolean, Int]

In this case, only C may be returned, since D is not a subtype of M[String, Int] (i.e., type parameters are relevant). It's probably worth to check what JDT does in this case (and emulate the behavior)

One more thing, in the display, it would be good to show the full type (i.e., M[String, Int], and not just M) - also for this, check what JDT does :-)

dotta commented 11 years ago

I just had the following exception

An internal error occurred during: "Finding subtypes of A".
underlying.getLocation == null for: L/A/src/A.scala

This happened after closing the Type Hierarchy view after I closed the project that was used to perform the Type Hierarchy request.

Full stacktrace:

java.lang.NullPointerException: underlying.getLocation == null for: L/A/src/A.scala
    at scala.tools.eclipse.util.EclipseResource.path(EclipseFile.scala:97)
    at org.scala.tools.eclipse.search.searching.Finder$$anonfun$findSupertypes$1.apply$mcV$sp(Finder.scala:115)
    at org.scala.tools.eclipse.search.searching.Finder$$anonfun$findSupertypes$1.apply(Finder.scala:115)
    at org.scala.tools.eclipse.search.searching.Finder$$anonfun$findSupertypes$1.apply(Finder.scala:115)
    at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:609)
    at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:607)
    at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:41)
    at scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:113)
    at scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:607)
    at scala.tools.eclipse.ScalaProject.withSourceFile(ScalaProject.scala:616)
    at scala.tools.eclipse.InteractiveCompilationUnit$class.withSourceFile(InteractiveCompilationUnit.scala:66)
    at scala.tools.eclipse.javaelements.ScalaSourceFile.withSourceFile(ScalaSourceFile.scala:60)
    at org.scala.tools.eclipse.search.searching.Finder.findSupertypes(Finder.scala:115)
    at org.scala.tools.eclipse.search.ui.TypeHierarchyView$$anonfun$createPartControl$1.apply(TypeHierarchyView.scala:80)
    at org.scala.tools.eclipse.search.ui.TypeHierarchyView$$anonfun$createPartControl$1.apply(TypeHierarchyView.scala:80)
    at org.scala.tools.eclipse.search.ui.TypeHierarchyTreeContentProvider$$anon$1.run(TypeHierarchyTreeContentProvider.scala:148)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
dotta commented 11 years ago

Btw, in the error log I just noticed this as well:

java.lang.NullPointerException
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$21$$anonfun$apply$22.apply(SearchPresentationCompiler.scala:315)
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$21$$anonfun$apply$22.apply(SearchPresentationCompiler.scala:315)
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)
mads-hartmann commented 11 years ago

@dotta The type alias example will have to be postponed for a bit. I need some more plumbing before we can handle that case.

But for the other cases, the tests introduced in 65d3ad9 should cover the cases right?

mads-hartmann commented 11 years ago

@dotta The tests don't pass yet but I would like to get the "spec" right before working more on the implementation. Let me know if you have any other cases I need to add. I'm taking a break for a couple of hours before working further on the implementation

mads-hartmann commented 11 years ago

Created a ticket for the type alias case

dotta commented 11 years ago

@mads379 I commented on 65d3ad9 But it looks good.

mads-hartmann commented 11 years ago

@dotta @dragos btw I currently show the generic super-types, i.e.

trait Foo[A]
trait StringFoo extends Foo[String]

Because I don't know how to get the concrete type.

typeOf[StringFoo].typeSymbol.parentSymbols

This gives me the symbols, so I can't get the concrete type instantiations

dotta commented 11 years ago

@mads379 You need to use the Type Tree to know the concrete type instantiation. If you use the symbol, you will get the abstract/generic one.

mads-hartmann commented 11 years ago

@mads379 You need to use the Type Tree to know the concrete type instantiation. If you use the symbol, you will get the abstract/generic one.

I was hoping that the symbol would know the concrete types of it's super types. Now that this is not the case I think I'll add a ticket for showing the concrete types :)

dotta commented 11 years ago

While building this PR, I got

[WARNING] /Users/mirco/Projects/ide/scala-search/org.scala.tools.eclipse.search.tests/src/org/scala/tools/eclipse/search/searching/ProjectFinderTest.scala:14: warning: imported `ProjectFinder' is permanently hidden by definition of object ProjectFinder in package searching
[WARNING] import org.scala.tools.eclipse.search.searching.ProjectFinder
dotta commented 11 years ago

So, I believe this is interesting.

I was looking at

    trait EntityImpl { this: Entity =>
      override def name = nme
      override def location = loc
      override def isReference(loc: Location) = createSymbolComparator(symbol).isSameAs(loc)
      override def alternativeNames = possibleNames(symbol).getOrElse(List(name))
    }

    trait TypeEntityImpl { this: TypeEntity =>
      override def name = nme
      override def location = loc
      override def isReference(loc: Location) = createSymbolComparator(symbol).isSameAs(loc)
      override def alternativeNames = possibleNames(symbol).getOrElse(List(name))
      override def displayName = typeName
      override def supertypes = directSupertypes(symbol)
    }

    if (symbol.isTrait) new Trait with TypeEntityImpl
    else if (symbol.isClass) new Class with TypeEntityImpl
    else if (symbol.isModule) new Module with TypeEntityImpl
    else if (symbol.isType) new Type with TypeEntityImpl
    else if (symbol.isMethod) new Method with EntityImpl
    else if (symbol.isVal) new Val with EntityImpl
    else if (symbol.isVar) new Var with EntityImpl
    else new UnknownEntity with EntityImpl

And asked for the type hierarchy of TypeEntityImpl. What would you expect it to be? I was expecting to see things like: new Trait with TypeEntityImpl, ... just like JDT does. But didn't quite get that back. I believe it's a bug.

dotta commented 11 years ago

Looks like I'm seing another bug here:

sealed abstract class TypeHierarchyNode
case class EvaluatedNode(elem: Confidence[TypeEntity]) extends TypeHierarchyNode
case object EvaluatingNode extends TypeHierarchyNode
case object LeafNode extends TypeHierarchyNode

Asking for Type Hierarchy of TypeHierarchyNode gives back type, type, EvaluatedNode

dotta commented 11 years ago

@mads379 You may want to do some more monkey testing and add tests as needed :)

mads-hartmann commented 11 years ago

And asked for the type hierarchy of TypeEntityImpl. What would you expect it to be?

The current behaviour is definitely a bug. It currently lists the sub-types of TypeEntity as subtypes of TypeEntityImpl which it shouldn't.

I would expect it to not find any sub-type as we're not declaring a type, but simply instantiating one. For example in the following case I would find it weird if it listed new Foo in the type hierarchy.

trait Foo {
  def bar: String
}
val foo = new Foo {
  override def bar = "test"
}
dotta commented 11 years ago

And asked for the type hierarchy of TypeEntityImpl. What would you expect it to be?

The current behaviour is definitely a bug. It currently lists the sub-types of TypeEntity as subtypes of TypeEntityImpl which it shouldn't.

I would expect it to not find any sub-type as we're not declaring a type, but simply instantiating one. For example in the following case I would find it weird if it listed new Foo in the type hierarchy.

trait Foo {
  def bar: String
}
val foo = new Foo {
  override def bar = "test"
}

I think it should, because you are effectively creating a subtype of Foo.

mads-hartmann commented 11 years ago

@dotta Alright, I'll have a look at it :) It shouldn't bee too hard to support

dotta commented 11 years ago

@mads379 If it's hard we can also just file a ticket ;-)

mads-hartmann commented 11 years ago

@dotta Added a test that failed, marked it with @Ignore and referenced the ticket

dotta commented 11 years ago

Found another bug

// c/C.scala
package c

class C

// a/A.scala
package a

import c.C

trait A { self: C => // <-- ask type hierarchy here for type `C`

}
dotta commented 11 years ago

I just got a really odd exception when triggering Type Hierarchy,but it only happened once and I can't reproduce it.

java.lang.NullPointerException
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)

and

scala.reflect.internal.FatalError: No synthetics for method FileHelper: synthetics contains 
    at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:49)
    at scala.tools.nsc.Global.abort(Global.scala:254)
    at scala.tools.nsc.typechecker.MethodSynthesis$MethodSynth$class.addDerivedTrees(MethodSynthesis.scala:243)
    at scala.tools.nsc.typechecker.Namers$Namer.addDerivedTrees(Namers.scala:55)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$31.apply(Typers.scala:1916)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$31.apply(Typers.scala:1916)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$rewrappingWrapperTrees$1.apply(Typers.scala:1855)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$rewrappingWrapperTrees$1.apply(Typers.scala:1852)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
    at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
    at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1916)
    at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1758)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5549)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2927)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5267)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5553)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2927)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5267)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5553)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2927)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5267)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5553)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5670)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
    at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1153)
    at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1153)
    at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207)
    at scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1153)
    at scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1146)
    at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:585)
    at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typedTreeAt(Global.scala:734)
    at scala.tools.nsc.interactive.Global$$anonfun$getTypedTreeAt$1.apply(Global.scala:757)
    at scala.tools.nsc.interactive.Global$$anonfun$getTypedTreeAt$1.apply(Global.scala:757)
    at scala.tools.nsc.interactive.Global$$anonfun$respond$1.apply(Global.scala:616)
    at scala.tools.nsc.interactive.Global$$anonfun$respond$1.apply(Global.scala:616)
    at scala.tools.nsc.interactive.Global.respondGradually(Global.scala:623)
    at scala.tools.nsc.interactive.Global.respond(Global.scala:616)
    at scala.tools.nsc.interactive.Global.getTypedTreeAt(Global.scala:757)
    at scala.tools.nsc.interactive.CompilerControl$AskTypeAtItem.apply$mcV$sp(CompilerControl.scala:349)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:388)
    at scala.tools.nsc.interactive.Global.checkForMoreWork(Global.scala:400)
    at scala.tools.nsc.interactive.Global.signalDone(Global.scala:253)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5635)
    at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:3041)
    at scala.tools.nsc.typechecker.Typers$Typer.loop$1(Typers.scala:3068)
    at scala.tools.nsc.typechecker.Typers$Typer.typedArgs(Typers.scala:3073)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$handleMonomorphicCall$1(Typers.scala:3330)
    at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3374)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$91.apply(Typers.scala:4534)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$91.apply(Typers.scala:4534)
    at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:727)
    at scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:4534)
    at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4592)
    at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4625)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5530)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2432)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5536)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5687)
    at scala.tools.nsc.typechecker.Typers$Typer.typedCase(Typers.scala:2472)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedCases$1.apply(Typers.scala:2502)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedCases$1.apply(Typers.scala:2501)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedCases(Typers.scala:2501)
    at scala.tools.nsc.typechecker.Typers$Typer.typedTry$1(Typers.scala:5321)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5561)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2927)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2431)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5536)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5811)
    at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2256)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5535)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2927)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1918)
    at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1758)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5549)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2927)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5267)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5553)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2927)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5267)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5553)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2927)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3031)
    at scala.collection.immutable.List.loop$1(List.scala:170)
    at scala.collection.immutable.List.mapConserve(List.scala:186)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3031)
    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5267)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5553)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5608)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5670)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
    at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1153)
    at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1153)
    at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207)
    at scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1153)
    at scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1146)
    at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:585)
    at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typedTreeAt(Global.scala:734)
    at scala.tools.nsc.interactive.Global$$anonfun$getTypedTreeAt$1.apply(Global.scala:757)
    at scala.tools.nsc.interactive.Global$$anonfun$getTypedTreeAt$1.apply(Global.scala:757)
    at scala.tools.nsc.interactive.Global$$anonfun$respond$1.apply(Global.scala:616)
    at scala.tools.nsc.interactive.Global$$anonfun$respond$1.apply(Global.scala:616)
    at scala.tools.nsc.interactive.Global.respondGradually(Global.scala:623)
    at scala.tools.nsc.interactive.Global.respond(Global.scala:616)
    at scala.tools.nsc.interactive.Global.getTypedTreeAt(Global.scala:757)
    at scala.tools.nsc.interactive.CompilerControl$AskTypeAtItem.apply$mcV$sp(CompilerControl.scala:349)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:388)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)

I see a NullPointer, I think we can fix this by being defensive on null.

dotta commented 11 years ago

Another one:

Trigger Type Hierarchy at this line https://github.com/scala-ide/scala-ide/blob/master/org.scala-ide.sdt.core/src/scala/tools/eclipse/GeneralScalaJavaBuilder.scala#L25, for the type ReflectionUtils, and in the Error Log you get 3 exceptions:

1)

java.lang.NullPointerException
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)

2)

java.lang.NullPointerException
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:344)
    at scala.tools.nsc.interactive.Global.checkForMoreWork(Global.scala:400)
    at scala.tools.nsc.interactive.Global.signalParseProgress(Global.scala:229)
    at scala.tools.nsc.ast.parser.Parsers$Parser.funDefRest(Parsers.scala:2574)
    at scala.tools.nsc.ast.parser.Parsers$Parser.funDefOrDcl(Parsers.scala:2537)
    at scala.tools.nsc.ast.parser.Parsers$Parser.defOrDcl(Parsers.scala:2420)
    at scala.tools.nsc.ast.parser.Parsers$Parser.nonLocalDefOrDcl(Parsers.scala:2432)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$templateStatSeq$1$$anonfun$apply$5.apply(Parsers.scala:2996)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$templateStatSeq$1$$anonfun$apply$5.apply(Parsers.scala:2996)
    at scala.tools.nsc.ast.parser.Parsers$Parser.joinComment(Parsers.scala:683)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$templateStatSeq$1.apply(Parsers.scala:2996)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$templateStatSeq$1.apply(Parsers.scala:2965)
    at scala.tools.nsc.ast.parser.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:428)
    at scala.tools.nsc.ast.parser.Parsers$Parser.templateStatSeq(Parsers.scala:2965)
    at scala.tools.nsc.ast.parser.Parsers$Parser.templateBody(Parsers.scala:2845)
    at scala.tools.nsc.ast.parser.Parsers$Parser.templateBodyOpt(Parsers.scala:2852)
    at scala.tools.nsc.ast.parser.Parsers$Parser.template(Parsers.scala:2789)
    at scala.tools.nsc.ast.parser.Parsers$Parser.templateOpt(Parsers.scala:2807)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$classDef$1.apply(Parsers.scala:2708)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$classDef$1.apply(Parsers.scala:2689)
    at scala.tools.nsc.ast.parser.Parsers$Parser.savingClassContextBounds(Parsers.scala:290)
    at scala.tools.nsc.ast.parser.Parsers$Parser.classDef(Parsers.scala:2689)
    at scala.tools.nsc.ast.parser.Parsers$Parser.tmplDef(Parsers.scala:2665)
    at scala.tools.nsc.ast.parser.Parsers$Parser.topLevelTmplDef(Parsers.scala:2650)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$topStatSeq$2.apply(Parsers.scala:2936)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$topStatSeq$2.apply(Parsers.scala:2936)
    at scala.tools.nsc.ast.parser.Parsers$Parser.joinComment(Parsers.scala:683)
    at scala.tools.nsc.ast.parser.Parsers$Parser.topStatSeq(Parsers.scala:2936)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$compilationUnit$1.topstats$1(Parsers.scala:3131)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$compilationUnit$1.topstats$1(Parsers.scala:3123)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$compilationUnit$1.apply(Parsers.scala:3137)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$compilationUnit$1.apply(Parsers.scala:3101)
    at scala.tools.nsc.ast.parser.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:428)
    at scala.tools.nsc.ast.parser.Parsers$Parser.compilationUnit(Parsers.scala:3101)
    at scala.tools.nsc.ast.parser.Parsers$SourceFileParser$$anonfun$parseStartRule$1.apply(Parsers.scala:141)
    at scala.tools.nsc.ast.parser.Parsers$SourceFileParser$$anonfun$parseStartRule$1.apply(Parsers.scala:141)
    at scala.tools.nsc.ast.parser.Parsers$Parser.parse(Parsers.scala:313)
    at scala.tools.nsc.ast.parser.Parsers$UnitParser.smartParse(Parsers.scala:242)
    at scala.tools.nsc.ast.parser.SyntaxAnalyzer$ParserPhase.apply(SyntaxAnalyzer.scala:29)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2$$anonfun$apply$1.apply(Global.scala:1683)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2$$anonfun$apply$1.apply(Global.scala:1683)
    at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2.apply(Global.scala:1683)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2.apply(Global.scala:1682)
    at scala.collection.Iterator$class.foreach(Iterator.scala:727)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1682)
    at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$parseAndEnter(Global.scala:573)
    at scala.tools.nsc.interactive.Global.backgroundCompile(Global.scala:480)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:25)

3)

java.lang.NullPointerException
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
    at scala.tools.nsc.interactive.Global.checkForMoreWork(Global.scala:400)
    at scala.tools.nsc.interactive.Global.signalParseProgress(Global.scala:229)
    at scala.tools.nsc.ast.parser.Parsers$Parser.funDefRest(Parsers.scala:2574)
    at scala.tools.nsc.ast.parser.Parsers$Parser.funDefOrDcl(Parsers.scala:2537)
    at scala.tools.nsc.ast.parser.Parsers$Parser.defOrDcl(Parsers.scala:2420)
    at scala.tools.nsc.ast.parser.Parsers$Parser.nonLocalDefOrDcl(Parsers.scala:2432)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$templateStatSeq$1$$anonfun$apply$5.apply(Parsers.scala:2996)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$templateStatSeq$1$$anonfun$apply$5.apply(Parsers.scala:2996)
    at scala.tools.nsc.ast.parser.Parsers$Parser.joinComment(Parsers.scala:683)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$templateStatSeq$1.apply(Parsers.scala:2996)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$templateStatSeq$1.apply(Parsers.scala:2965)
    at scala.tools.nsc.ast.parser.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:428)
    at scala.tools.nsc.ast.parser.Parsers$Parser.templateStatSeq(Parsers.scala:2965)
    at scala.tools.nsc.ast.parser.Parsers$Parser.templateBody(Parsers.scala:2845)
    at scala.tools.nsc.ast.parser.Parsers$Parser.templateBodyOpt(Parsers.scala:2852)
    at scala.tools.nsc.ast.parser.Parsers$Parser.template(Parsers.scala:2789)
    at scala.tools.nsc.ast.parser.Parsers$Parser.templateOpt(Parsers.scala:2807)
    at scala.tools.nsc.ast.parser.Parsers$Parser.objectDef(Parsers.scala:2731)
    at scala.tools.nsc.ast.parser.Parsers$Parser.tmplDef(Parsers.scala:2669)
    at scala.tools.nsc.ast.parser.Parsers$Parser.topLevelTmplDef(Parsers.scala:2650)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$topStatSeq$2.apply(Parsers.scala:2936)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$topStatSeq$2.apply(Parsers.scala:2936)
    at scala.tools.nsc.ast.parser.Parsers$Parser.joinComment(Parsers.scala:683)
    at scala.tools.nsc.ast.parser.Parsers$Parser.topStatSeq(Parsers.scala:2936)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$compilationUnit$1.topstats$1(Parsers.scala:3131)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$compilationUnit$1.topstats$1(Parsers.scala:3123)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$compilationUnit$1.apply(Parsers.scala:3137)
    at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$compilationUnit$1.apply(Parsers.scala:3101)
    at scala.tools.nsc.ast.parser.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:428)
    at scala.tools.nsc.ast.parser.Parsers$Parser.compilationUnit(Parsers.scala:3101)
    at scala.tools.nsc.ast.parser.Parsers$SourceFileParser$$anonfun$parseStartRule$1.apply(Parsers.scala:141)
    at scala.tools.nsc.ast.parser.Parsers$SourceFileParser$$anonfun$parseStartRule$1.apply(Parsers.scala:141)
    at scala.tools.nsc.ast.parser.Parsers$Parser.parse(Parsers.scala:313)
    at scala.tools.nsc.ast.parser.Parsers$UnitParser.smartParse(Parsers.scala:242)
    at scala.tools.nsc.ast.parser.SyntaxAnalyzer$ParserPhase.apply(SyntaxAnalyzer.scala:29)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2$$anonfun$apply$1.apply(Global.scala:1683)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2$$anonfun$apply$1.apply(Global.scala:1683)
    at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2.apply(Global.scala:1683)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2.apply(Global.scala:1682)
    at scala.collection.Iterator$class.foreach(Iterator.scala:727)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1682)
    at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$parseAndEnter(Global.scala:573)
    at scala.tools.nsc.interactive.Global.backgroundCompile(Global.scala:480)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:25)

The functionality seems to be almost intact (the Type Hierarchy view is filled up). However, one of the reported types has a leading (?) in its name.

dotta commented 11 years ago

And here is another bug:

class A

class B extends A {
  classOf[B] //<-- ask type hierarchy for `B`
}

Type Hierarchy view is empty, and the following exception is added in the Error Log view.

java.lang.NullPointerException
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$18$$anonfun$apply$19.apply(SearchPresentationCompiler.scala:258)
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)
mads-hartmann commented 11 years ago
package a {
  class A
}
package b {
  import a.A
  trait B { this: |A => }
}

Asking for the symbol of the | will give a tree with NoSymbol. The tree node is Ident so that is correct, it just doesn't have the symbol attached.

Using the fully qualified identifier works.

package a {
  class A
}
package b {
  trait B { this: a.|A => }
}
dotta commented 11 years ago

@mads379 Alright, even @dragos doesn't know why we get a NoSymbol :-). Maybe it's a compiler bug, who knows. So, let's do the following for that test case: create a test and @Ignore it, file a ticket, and send an email on scala-internals to see if anyone has an idea (please, cc-ing me)

dotta commented 11 years ago

If you ask Type Hierarchy on an empty space you get the error dialog "Report a bug", which is likely not what we want ;-) - it should just be a noop.

dotta commented 11 years ago

Found another bug:

package a {
  class A // <-- Ask Type Hierarchy here
  abstract class B extends Function[A,Unit]
}

It returns that B <: A :-)